Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7826747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:33:27+00:00 2026-06-02T09:33:27+00:00

As the title state, I have a bit problem with sql statement. I have

  • 0

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T09:33:29+00:00Added an answer on June 2, 2026 at 9:33 am

    You can use DateDiff in your query.

    SELECT DateDiff("d",[Date_time_use],[Date_time_booking]) AS Diff
    FROM Table1
    

    You can create a query using the query design window.

    Edit re comments

    SELECT 
       Member_ID, 
       Sum(DateDiff("d",[Date_time_to_use],[Date_time_booked])) AS Sum_Day_in_advance
    FROM Court_booking
    GROUP BY Member_ID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two table classifieds and state . classifieds - id, title, state_id state
I have 2 prefs - a song title and the audio state(mute or volume)
I have a very basic UPDATE SQL - UPDATE HOLD_TABLE Q SET Q.TITLE =
My title is a bit vauge, here's the problem I'm talking about. Say I
i shall state my problem here.. I have an index.html page which has a
As the title states, I have a C# console app which uses interop to
As per the title, is this possible? By tri-state, I mean the parent node
The title of the question pretty much states the problem. Is it possible?
Ok, so the title is a bit convoluted. This is basically a greatest-n-per-group type
As stated in the title, I have to write a simple script which should

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.