Link to home
Start Free TrialLog in
Avatar of Gordon Hughes
Gordon HughesFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Formula showing date range

I have the following formula which works ok

select * from MembersDetails
[Membership Main} in ["Junior Intmd", "Junior U12", "Junior U18", "Social TP", "Tennis", "Tennis 18 25", "Tennis Day", "Tennis Ovr65", "Social"]
where [Renewal Date] > '2020-04-02 00:00:00.000'
and [Payment Date]   > '2020-02-02 00:00:00.000'
order by [Membership Main]


I want the [Payment Date] to show between fixed dates ie 2020-02-01 00:00:00 and 2020-04-02 00:00:00
ASKER CERTIFIED SOLUTION
Avatar of Sam Jacobs
Sam Jacobs
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The other option is just add and [payment date] <= '2020-04-02'
To your existing. Add >=
Avatar of Norie
Norie

Try this.
SELECT * 
FROM MembersDetails
WHERE
[Membership Main] in ("Junior Intmd", "Junior U12", "Junior U18", "Social TP", "Tennis", "Tennis 18 25", "Tennis Day", "Tennis Ovr65", "Social")
AND [Renewal Date] > '2020-04-02 00:00:00'
AND [Payment Date] >= '2020-02-01 00:00:00'
AND [Payment Date] <= '2020-04-02 00:00:00'
ORDER BY [Membership Main]

Open in new window

Avatar of Gordon Hughes

ASKER

Sam

Well done
Gordon
Thank you,  Gordon.
-Sam