Hi
I am using the data environment in VB6 to create reports based on a MS SQL Database. I am trying to pick items from the tables that fall on a particular date.
I use a date picker on a form to select the required date and import it into the data environment as a parameter (?).
The date picker supplies a date in the format dd/mm/yyyy.
The date in the db is a Date/Time Stamp hence the need for the format. Can anybody see what I am doing wrong.
SELECT Operators.Op_ID, Operators.Op_Name, Sessions.Produced, Sessions.Running_Time, Sessions.Stopped_Time, Sessions.Shift_No, Sessions.Start_Date, 'Format(Sessions.Start_Date, yyyymmdd)' AS Expr1 FROM Sessions INNER JOIN Operators ON Sessions.Operator_ID = Operators.Op_ID WHERE (Sessions.Shift_No = 3) AND ('Format(Sessions.Start_Date, yyyymmdd)' = ?)
Regards
Alan Edwards
85% of statistics that are quoted are entirely made up!
I am using the data environment in VB6 to create reports based on a MS SQL Database. I am trying to pick items from the tables that fall on a particular date.
I use a date picker on a form to select the required date and import it into the data environment as a parameter (?).
The date picker supplies a date in the format dd/mm/yyyy.
The date in the db is a Date/Time Stamp hence the need for the format. Can anybody see what I am doing wrong.
SELECT Operators.Op_ID, Operators.Op_Name, Sessions.Produced, Sessions.Running_Time, Sessions.Stopped_Time, Sessions.Shift_No, Sessions.Start_Date, 'Format(Sessions.Start_Date, yyyymmdd)' AS Expr1 FROM Sessions INNER JOIN Operators ON Sessions.Operator_ID = Operators.Op_ID WHERE (Sessions.Shift_No = 3) AND ('Format(Sessions.Start_Date, yyyymmdd)' = ?)
Regards
Alan Edwards
85% of statistics that are quoted are entirely made up!