BETWEEN command not working

19 views
Skip to first unread message

Niels B

unread,
Jul 3, 2020, 9:52:05 AM7/3/20
to dbfit
Hi everyone,

I would like to run a query that selects all records between two dates. first I tried > timestamp but > and < operators don't work in dbfit.
So I tried a between statement. But I cannot get it working. Anyone know a fix for this?

|set parameter|TS1|'2020-07-02 00:01:00'|
|set parameter|TS2|'2020-07-02 23:59:00'|

!*> Query testdata in target tabel: VOLTHIS_NAME
|Query      |!-Select NR, DATE_FROM from VOLTHIS_NAME WHERE DATE_FROM BETWEEN :TS1 AND :TS2-!|
|NR                                                                                                 |DATE_FROM               |
|_76342GKJG_V_2_12345123456789012345678901234567890|2020-07-02 16:38:29.0|
*!

James

unread,
Sep 22, 2020, 1:16:22 PM9/22/20
to dbfit
Hi - my guess it is because you have set the parameters as strings but need to cast them as dates or timestamps (according to your database documentation).

Which database are you running the tool through?
Reply all
Reply to author
Forward
0 new messages