select data between 2 date columns

Dave_epic

Registered User.
Local time
Today, 20:45
Joined
Mar 6, 2008
Messages
39
I have a table with 2 date columns which are different for each record. I have another column of numbers where I only want to select '1' for example if it is between the dates in the 2 date columns. I guess I should BETWEEN or DATE RANGE but I can't make it work with sql.

Help appreciated
Thanks
 
I have a table with 2 date columns which are different for each record. I have another column of numbers where I only want to select '1' for example if it is between the dates in the 2 date columns. I guess I should BETWEEN or DATE RANGE but I can't make it work with sql.

Help appreciated
Thanks
It is not clear what should be between the dates in your description. Is there a third date? Is it Today's date. Post some more ionformation and you may get some help.

What have you tried so far and what happened. Help us to help you.
 
Thanks but I figured it out.

There were 4 columns Data, Date, Date1,Date2,
I just wanted to select from Data where Date fell between Date1 and Date2.

pretty simple really.


SELECT Data, Date, Date1,Date2,
FROM table1
WHERE (((Data)=1) AND ((Date) Between Date1 And Date2));
 
Thanks but I figured it out.

There were 4 columns Data, Date, Date1,Date2,
I just wanted to select from Data where Date fell between Date1 and Date2.

pretty simple really.


SELECT Data, Date, Date1,Date2,
FROM table1
WHERE (((Data)=1) AND ((Date) Between Date1 And Date2));
You would have got an answer quicker if you had actually told us you had 3 date fields. Ss it was you said you had 2 date columns.

Anyway I am glad you have got it sorted.
 
Yes, that's my fault sorry. Thanks for the help though.
 

Users who are viewing this thread

Back
Top Bottom