Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7716 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hi all,

I am trying to use SQL UPDATE command to update a field defined as Time field. What I noticed is if I do it after 10:00 AM then the code works fine. If I do it before 10 AM then I get a ODBC error - Invalid Date Value.

I am inserting the code snippet here. The tstring is a string value that is being passed to the SQL string. I printed SQL string just before execution. Every thing looks fine. But when the statement is executed I get the ODBC error.

For eg.; say I executed the SQL at 1:22:15 AM the value in tstring is 01:22:15 AM. Same as in SQL String, but when the SQL is executed the ODBC error I get say Invalid Date Value 1:22:15 PM. So the leading ZERO is missing and also AM changed to PM. What am I doing wrong ?

Here is the code -

sqlString2 = "UPDATE reassigns SET endDate={" & endDate

sqlString2 = sqlString2 & "}, endTime={" & tstring

sqlString2 = sqlString2 & "}, endType = 2"

sqlString2 = sqlString2 & ", wrkDuration = " & techDuration

sqlString2 = sqlString2 & " where techReqID = " & triggerID

sqlString2 = sqlString2 & " and endType = 0"

This topic is 7716 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.