Dates

LEE hepworth

Registered User.
Local time
Today, 01:40
Joined
Nov 14, 2003
Messages
23
Using this
Between DateValue(Date()-(Weekday(Date(),"vbWednesday")+6)) And DateValue(Date()-Weekday(Date(),"vbWednesday"))


in order to get sales from certain dates

Using Access 97 and the field is called Date have changed this field to another name and also chechked that Date/ Time is being used but I keep getting this error when i put the above statement in creterior of the query

Please Help.....

Data type mismatch in creteria expression
 
Firstly, the vbWednesday is an enumerated constant for use in code; you can't use it in a query criteria.

Also, you had it as a string which is why you had a data type mismatch. The argument expected is an integer.

Luckily, the argument will still work if you replace the enumerated constant vbWednesday with its numerical equivalent. 4

So:

Between DateValue(Date()-(Weekday(Date(),4)+6)) And
DateValue(Date()-Weekday(Date(),4))
 

Users who are viewing this thread

Back
Top Bottom