JoeUS
asked on
use stored proc with dynamic sql for datetime / varchar convert
I have a report where the stored procedure is dynamically created with a datetime parameter.
The date time parameter uses the calendar control and passes the datetime value back to the stored procedure to fetch the records back to the report.
In order to dynamically create the query I need to convert the calendar control datetime format to varchar with the format "mm/dd/yyyy hh:dd:mm"
SELECT @m_strOnDate = UPPER(CONVERT(VARCHAR(19), @dtOnDate, 120))
the desired format is
"MM/DD/YYYY hh:mm:ss"
thank you
The date time parameter uses the calendar control and passes the datetime value back to the stored procedure to fetch the records back to the report.
In order to dynamically create the query I need to convert the calendar control datetime format to varchar with the format "mm/dd/yyyy hh:dd:mm"
SELECT @m_strOnDate = UPPER(CONVERT(VARCHAR(19),
the desired format is
"MM/DD/YYYY hh:mm:ss"
thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.