As the title state, I have a bit problem with sql statement. I have a table as below, 3 columns : date_time_booking, date_time_use, member_ID
Date_time_booking
- 1/4/2012
- 2/4/2012 etc.
Date_time_use
- 5/4/2012
- 10/4/2012 etc.
Member_ID is Null if it is a non_member booking, not Null if it is a member
I need a query to calculate how far in advance of the booking of member and non-member of the sport center. Help/Correction/Suggestion are appreciated. Thank you
EDIT: This is what I have so far
SELECT
Member_ID,
DateDiff("d",[Date_time_to_use],[Date_time_booked]) AS Day_in_advance
FROM Court_booking
GROUP BY Member_ID
You can use DateDiff in your query.
You can create a query using the query design window.
Edit re comments