Announcement

Collapse
No announcement yet.

Advantage DB query syntax for date range

Collapse
X
 
  • Filter
  • Time
Clear All
new posts

    Advantage DB query syntax for date range

    I'm a SQL Server guy and don't query Advantage DB directly very often so am weak on syntax subtleties. Am trying to fetch all charges between two dates and no matter what variations I try it's always some kind of conversion failure or invalid operator for the type.

    select * from slips
    where SlipDate >= '05/09/2020 12:00:00 AM'
    and SlipDate <= '05/15/2020 12:59:59 PM'

    I've tried formatting the dates as 2020/05/09 and 2020-05-09, even tried doing a CONVERT to sql_timestamp. Nothing works.

    One complicating factor is I'm doing this through a linked server query and quoted strings are a pain with the OPENQUERY() function so if the above is supposed to be working than that'll be important to know.

    Thanks for any advice!

    -- Craig

    Re: Advantage DB query syntax for date range

    Thank you for asking. Please give the following a try:

    select * from slips
    where SlipDate >= '05/09/2020 00:00'
    and SlipDate <= '05/15/2020 23:59'

    Comment


      Re: Advantage DB query syntax for date range

      Thanks for such a quick response. That's one variation I had not tried.

      Comment

      Working...
      X