issue with date ordering

  • Thread starter Thread starter Associates
  • Start date Start date
A

Associates

Hi,

I wonder if i could get some help with the following issue with the date

When i do query as below

mycurrdate = Format(now, "d/mm/yyyy")
myWeeklyIDCounter = DCount("[WeeklyID]", "WeeklyReport", "[Student_No] = '"
& Me.LB_ActiveJobs.Column(1) & "' And [Weekly_Date]= #" & mycurrdate & "#")

if let's say today is 8th Feb 2008, then mycurrdate should be "8/02/2008".
In the table, there are many records with that date but it returns nothing
after executing this query. After a while, i figure that it's to do with the
order of the month and the day. It changes the order - it becomes 2/08/2008.

how do i make sure that it stays as 8/02/2008 (8th Feb)? i know the computer
gets confused but there must be a way of getting around this problem?

Thank you in advance
 
Hi,

I wonder if i could get some help with the following issue with the date

When i do query as below

mycurrdate = Format(now, "d/mm/yyyy")
myWeeklyIDCounter = DCount("[WeeklyID]", "WeeklyReport", "[Student_No] = '"
& Me.LB_ActiveJobs.Column(1) & "' And [Weekly_Date]= #" & mycurrdate & "#")

if let's say today is 8th Feb 2008, then mycurrdate should be "8/02/2008".
In the table, there are many records with that date but it returns nothing
after executing this query. After a while, i figure that it's to do with the
order of the month and the day. It changes the order - it becomes 2/08/2008.

how do i make sure that it stays as 8/02/2008 (8th Feb)? i know the computer
gets confused but there must be a way of getting around this problem?

Thank you in advance

Don't confuse data DISPLAY with data STORAGE and MANIPULATION.

You must use either a mm/dd/yyyy format, or an unambiguous format such as
yyyy-mm-dd as your search criterion.

The result of the search can be formatted any way you like, and has nothing to
do with the value used in the search criterion.
 
Back
Top