vavs123
29th April 2002, 16:53
I am trying to write a simple query that will count the number of orders which were complete for a given date range. I am using the SQL queries module. I am stuck on the proper syntax for the query's where clause. I tried this and got an error:
where
tisfc001.cmdt between tcdate.f and tcdate.t
I thought that this should bring up a request for the two dates.

Am I wrong?

Probably yes.

MariaC
29th April 2002, 17:23
I think you should rather have:
tisfc001.cmdt >= tisfc001.cmdt.f and
tisfc001.cmdt <= tisfc001.cmdt.t

vavs123
29th April 2002, 17:34
It works perfectly thank you.

gguymer
29th April 2002, 19:17
This is where clause is basically correct:
where
tisfc001.cmdt between tcdate.f and tcdate.t
except variables need a colon (:) preceding them as shown.
where
tisfc001.cmdt between :tcdate.f and :tcdate.t
This statement will compile without errors now.

Gilbert Guymer
Database Administrator
Lufkin Industries, Inc.