Select between two dates

I’m trying to create a query to return all entries between to dates with no luck. It allows me to input the first date (Start Date )but will not show the second date (End Date)…
Any Ideas
Thanks
Bob

SELECT hours.RosterID, memberpersonalinfo.Last_Name, memberpersonalinfo.First_Name, SUM( hours.Hours ), rosterinfo.Position, hours.Dateworked AS Start_Date, hours.Dateworked AS End_Date FROM security.hours AS hours, security.memberpersonalinfo AS memberpersonalinfo, security.rosterinfo AS rosterinfo WHERE hours.RosterID = memberpersonalinfo.RosterID AND hours.RosterID = rosterinfo.RosterID AND hours.Dateworked >= ? AND hours.Dateworked <= ? GROUP BY hours.RosterID

Which database engine do you use?
If you start a query through Base-GUI:
…"hours"."Dateworked" BETWEEN :startDate AND :endDate …
or
…"hours"."Dateworked" >= :startDate AND "hours"."Dateworked" <= :endDate …
Different parameter will need different names in Base GUI. Prepared statements (for example in macros) will work with ‘?’.

1 Like