FormerMember

ODBC Time Compare

Posted By FormerMember

I'm trying to do a compare of Sage 100 TIME (hours past midnight - fractional) column in a SQL WHERE statement. I was able to get the DATE field to work with {d '2021-09-16'} but there doesn't seem to be a [t '17.500000'} like scalar function for TIME. Does anyone have a suggestion how I can do a compare with a Sage 100 TIME column?

Parents
  • FormerMember
    FormerMember

    Resolved:

    I was going to delete the post since I figured it out but thought it might save someone else some time by posting the answer.

    You need to compare the TIME field as if it were a string.

    LogTime >= '03.90'

  • FormerMember
    FormerMember in reply to FormerMember

    Next problem I ran into is TIME rollover with SQL compare. Why Sage doesn't use normal datetime stamps is beyond me.

    I'm converting the date and time columns to a Julian date. ScriptBasic date /time math is based on seconds past Jan. 1st, 1970.

Reply
  • FormerMember
    FormerMember in reply to FormerMember

    Next problem I ran into is TIME rollover with SQL compare. Why Sage doesn't use normal datetime stamps is beyond me.

    I'm converting the date and time columns to a Julian date. ScriptBasic date /time math is based on seconds past Jan. 1st, 1970.

Children