Dates is it # June or October !!!!! #

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The below code is extracting data from the 6th of October 2006
(6/10/2006) but the input value (date_s) from the form asks for data from the
10 th of June (10/06/206).

How can I stop the values from switching?

stLinkCriteria = "[issue]=" & "'" & Me![Original] & "'" _
& "and" & "[Date completed] between" & "#" & Me![Date_s] & "#" _
& "and" & "#" & Me![Date_e] & "#"

Any help much appreciated,
David
 
David_Williams_PG said:
The below code is extracting data from the 6th of October 2006
(6/10/2006) but the input value (date_s) from the form asks for data from the
10 th of June (10/06/206).

How can I stop the values from switching?

stLinkCriteria = "[issue]=" & "'" & Me![Original] & "'" _
& "and" & "[Date completed] between" & "#" & Me![Date_s] & "#" _
& "and" & "#" & Me![Date_e] & "#"


Unless you specify how you want the date formatted, Access
will use the system settings when converting a date value to
a string. The format you need to specify must be either
m/d/yyy or yyy-m-d.

.... between " & Format(Me![Date_s], "\#yyyy\-m\-d\#") _
& " And " & Format(Me![Date_e], "\#yyyy\-m\-d\#")

Note that you need spaces around the keywords so everything
doesn't run together.
 
Back
Top