Ok, I solved my own issue. The problem is that (I believe) date/time datatype in Access/MSSQL contain the time too. Thus the =[selectedDate] won't work unless we specify the time too. Since we don't want to do that, there are numerous possibilities like using (1) >=[selectedDate] AND <[selectedDate+1moreDay]
- or - (2) LIKE [selecteddate%] (this option needs converting the months to concatenated string, i.e. April to apr, since LIKE makes string comparisons) - or - (3) YEAR(call_date) = '2003' AND MONTH(call_date) = '8' AND DAY(call_date) = '11' - or - (4) DATEPART(YEAR, call_date) = '2003' AND DATEPART(MONTH, call_date) = '04' AND DATEPART(DAY, call_date) = '09' - or - CAST(FLOOR(CAST([DateField] AS FLOAT))AS DATETIME) = 'selectedDate' The 2 last options work only in MSSQL I think, Access throws an error... Anyway, option 1 and 3 work marvelously. I prefer option 3 though! Paul > -----Original Message----- > From: Paul Larue [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 12, 2003 11:04 AM > To: [EMAIL PROTECTED] > Subject: [wdvltalk] Select Query in Access > > > Hi list, why won't this work? > SELECT * > FROM calls > WHERE call_for='Paul' AND call_date=#8/11/2003# > ORDER BY calls.call_for, calls.call_time DESC; > > > If I remove the condition on the date, then everything goes > fine. Of I substitute the =[CurrentDate] to an > >=[SmallerDate], then I get the results too. But that's not > how it SHOULD be and I thus doing something wrong. > > Anybody can help?... Rudy? > > Paul > > paul @ edsnetworks.net > > Enterprise Data Services Ltd. > Trade & Marketing Center > Mer Rouge > Republic of Mauritius > [T] 217 217 0 > [F] 206 277 4 > www.edsnetworks.net > > > ____ . The WDVL Discussion List from WDVL.COM . ____ > To Join wdvltalk, Send An Email To: > mailto:[EMAIL PROTECTED] > Send Your Posts > To: [EMAIL PROTECTED] > To set a personal password send an email to > [EMAIL PROTECTED] with the words: "set WDVLTALK > pw=yourpassword" in the body of the email. To change > subscription settings to the wdvltalk digest version: > http://wdvl.internet.com/WDVL/Forum/#sub > > ________________ http://www.wdvl.com _______________________ > > You are currently subscribed to wdvltalk as: > [EMAIL PROTECTED] To unsubscribe send a blank email to > %%email.unsub%% > > ____ � The WDVL Discussion List from WDVL.COM � ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED] To set a personal password send an email to [EMAIL PROTECTED] with the words: "set WDVLTALK pw=yourpassword" in the body of the email. To change subscription settings to the wdvltalk digest version: http://wdvl.internet.com/WDVL/Forum/#sub ________________ http://www.wdvl.com _______________________ You are currently subscribed to wdvltalk as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
