D
David
Hello All,
I am using a bit of code in VBA to edit an existing Pass Through Query. I
am using the dates the user selected on a form and passing it to the Pass
Through Query SQL.
Problem is the Pass Through Query is evidently needing the date in a very
specific format, to_date('01-SEP-2008')
The current code below results with to_date('9/1/2008'). What changes can I
make to produce the SQL in the right format?
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
Dim strSQL As String
Set dbs = CurrentDb
strSQL = "Select * from table_example tc where tc.creation_time >=
to_date('" & CDate(Forms!frm_Switchboard!txt_Start_Date) & "')"
This produces SQL ending
where tc.creation_time >= to_date('9/1/2008')
GOAL:
where tc.creation_time >= to_date('01-SEP-2008')
Any assistance you can provide is very much appreciated.
I am using a bit of code in VBA to edit an existing Pass Through Query. I
am using the dates the user selected on a form and passing it to the Pass
Through Query SQL.
Problem is the Pass Through Query is evidently needing the date in a very
specific format, to_date('01-SEP-2008')
The current code below results with to_date('9/1/2008'). What changes can I
make to produce the SQL in the right format?
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
Dim strSQL As String
Set dbs = CurrentDb
strSQL = "Select * from table_example tc where tc.creation_time >=
to_date('" & CDate(Forms!frm_Switchboard!txt_Start_Date) & "')"
This produces SQL ending
where tc.creation_time >= to_date('9/1/2008')
GOAL:
where tc.creation_time >= to_date('01-SEP-2008')
Any assistance you can provide is very much appreciated.