dbTalk Databases Forums  

Return record where date is between fields

comp.databases.informix comp.databases.informix


Discuss Return record where date is between fields in the comp.databases.informix forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
jared.hanks@gmail.com
 
Posts: n/a

Default Return record where date is between fields - 07-13-2007 , 08:14 PM






Hello,

I'm not exactly sure how to search on this, but I'm guessing this has
been done before and is quite easy. I just am not sure how to figure
it out.

I have a table that has week, year, and date information. It is
structured so I have a week number, year number, beginning date
(Sundays), and ending date (Saturdays) and these are only by weeks.
For example this is what it looks like:

wx_year wx_week wx_begdate wx_enddate wx_month

2007 1 02/04/2007 02/10/2007 1
2007 2 02/11/2007 02/17/2007 1
2007 3 02/18/2007 02/24/2007 1
2007 4 02/25/2007 03/03/2007 1
2007 5 03/04/2007 03/10/2007 2
2007 6 03/11/2007 03/17/2007 2
2007 7 03/18/2007 03/24/2007 2
2007 8 03/25/2007 03/31/2007 2
2007 9 04/01/2007 04/07/2007 2
2007 10 04/08/2007 04/14/2007 3
2007 11 04/15/2007 04/21/2007 3
and so on....

I would like to get the begging and ending date for today, but since
it's in the middle of the week I'm not exactly sure how I would do
this.

Any help is appreciated.

Thanks,
Jared


Reply With Quote
  #2  
Old   
Goldrick, Jim
 
Posts: n/a

Default RE: Return record where date is between fields - 07-13-2007 , 08:30 PM






I think you mean this.

select wx_begdate, wx_endate from table1 where today between wx_begdate and wx_enddate;

That should work if all your begin and endates are different.

jim

________________________________

From: informix-list-bounces (AT) iiug (DOT) org on behalf of jared.hanks (AT) gmail (DOT) com
Sent: Fri 7/13/2007 7:14 PM
To: informix-list (AT) iiug (DOT) org
Subject: Return record where date is between fields



Hello,

I'm not exactly sure how to search on this, but I'm guessing this has
been done before and is quite easy. I just am not sure how to figure
it out.

I have a table that has week, year, and date information. It is
structured so I have a week number, year number, beginning date
(Sundays), and ending date (Saturdays) and these are only by weeks.
For example this is what it looks like:

wx_year wx_week wx_begdate wx_enddate wx_month

2007 1 02/04/2007 02/10/2007 1
2007 2 02/11/2007 02/17/2007 1
2007 3 02/18/2007 02/24/2007 1
2007 4 02/25/2007 03/03/2007 1
2007 5 03/04/2007 03/10/2007 2
2007 6 03/11/2007 03/17/2007 2
2007 7 03/18/2007 03/24/2007 2
2007 8 03/25/2007 03/31/2007 2
2007 9 04/01/2007 04/07/2007 2
2007 10 04/08/2007 04/14/2007 3
2007 11 04/15/2007 04/21/2007 3
and so on....

I would like to get the begging and ending date for today, but since
it's in the middle of the week I'm not exactly sure how I would do
this.

Any help is appreciated.

Thanks,
Jared

_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.