asp_databases thread: Query standard '3/23/01' format using DatePart("ww",date) ?
I noticed no takers to my previous inquiry ;) Perhaps I was a bit vague?
How would I display a query using DatePart("ww",date) from a
standard '3/23/01' format taken from the database?
Currently the below SQL statements returns the date in the format the
users originally input as - 3/23/01 - for example.
' *****RELEVANT CODE*******
<%
Dim UN
Dim WK
UN = session("UserName")
WK = DatePart("ww",date)
%>
...
SELECT ID, week, Project_Manager, Customer_Name, Customer_Number, Service,
New_Orders, Change_Orders, Cutover_Orders, Pending_Orders, Status,
Comments, Project_Phase, FRI, SAT, SUN, MON, TUE, WED, THU from Timesheet
WHERE Project_Manager= '" & UN & "' AND week = '" & WK & "'
' *****END RELEVANT CODE*******
I still want the the users to input the date in the format '3/23/01', with
the actual report to pull all records within a 'week of year' format using:
WK = DatePart("ww",date)
based on the week of year requested via user query. I believe the problem
lies in that the user's input the date as '3/32/01' but the query would be
looking for a '12', the correct week of the year.
Can anyone help with this? I am confused at this point...
BRgds,
Scott Taylor