Problem with Date Parameters in Recordset (1 Viewer)

jon_sg

Registered User.
Local time
Today, 19:01
Joined
Oct 5, 2003
Messages
42
Can anyone help

I need to return records into a DAO recordset based on an SQL statement for the week of a year from a date stored in a table. I have had problems using the DatePart Function as an expression in the query.

Thanks for your help

Jon
 

RichO

Registered Yoozer
Local time
Today, 06:01
Joined
Jan 14, 2004
Messages
1,036
Specifically, what are you looking for referring to "the week of a year from a date"? Are you looking for a specific week by number (1-52)?
 

Tim K.

Registered User.
Local time
Today, 12:01
Joined
Aug 1, 2002
Messages
242
What error message did you get?

You might use ' instead of " in the SQL statement. Something like this.

SELECT DatePart('ww',Date()) AS WeekNum;

:)
 

jon_sg

Registered User.
Local time
Today, 19:01
Joined
Oct 5, 2003
Messages
42
Thanks folks

It was an embarrassingly simple simple solution really but I couldn't see it Yesterday, Instead of adding an extra col into the SQL stmnt to calculate DatePart("ww"", [Field])and getting the parameter from the form I was trying to compare two date parts in the where clause.

You know what its like after a long day.

Kind Regards

Jon
 

Users who are viewing this thread

Top Bottom