|
-
Mar 10th, 2002, 03:52 AM
#1
Thread Starter
Hyperactive Member
SQL Statement - please help !Solved!
I have a access DB with 2 fields "StartDate" and "EndDate"
I need now a SQL Statement which gives me all the
records which are falling in today.
Thanks in advance
Last edited by Bongo; Mar 10th, 2002 at 04:32 AM.
-
Mar 10th, 2002, 04:07 AM
#2
you want startdate for today or end date for today??
"SELECT * from mytable where startdate = " & datepart(now())
-
Mar 10th, 2002, 04:13 AM
#3
Thread Starter
Hyperactive Member
actually no
I need to know which record is today. - hang on
This app i am writing is an Reservation system
StartDate is arrival and EndDate is Depature
But I wnad to know how many rooms are booked today
so I need somthing like
select count(*) from table where - and now the part wher I have problems -
Is today between startdate and enddate
-
Mar 10th, 2002, 04:22 AM
#4
That's a bit unclear...
You want the number of rooms booked today... so would that be startdate = today? or do you want startdate AND endate as today?
OR you want the number of rooms currently booked, meaning that TODAY falls in between startdate and enddate... right?
so you don't even need startdate here... just end date. Today has to be less than end date.
Could u be a bit more clear?
-
Mar 10th, 2002, 04:31 AM
#5
Thread Starter
Hyperactive Member
mendhak,
Utpal from the VB DB forum answerd the question
SELECT Count(*) from table where DATE() between Start and End
Thanks for your help
-
Mar 10th, 2002, 04:55 AM
#6
I know, i saw that post.
I feel so betrayed. *sniff sniff*
heheh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|