August 31, 2009 at 6:16 am
hi experts
in my table i have a column with name Date and id
Date id
2009-7-13 218665
2009-7-14 218665
2009-7-15 218665
2009-7-16 218665
2009-7-19 218665
2009-7-20 218665
2009-7-21 218665
i want to know weather rows r present from one date to another. like fromdate and to date
if i have give from date =2009-7-13 and to date = 2009-7-20 it shuld compare with the date column it should not show the rows are present because 200-7-17 is not available.... so we have to check the date column from date between from date and date
if i have given from date = 2009-7-12 and todate= 2009-7-16 even it shuld not show because 2009-7-12 is not present and vice versa ..
if i have given fromdate =2009-7-13 and todate =2009-7-16 it shuld dispaly
plz guide me
August 31, 2009 at 6:58 am
I cant give the entire query, try creating row_id partition by date and your id. Create a temporary table of this may be. Cross join tables. Look for the existence of the record based on the row_id (Where table1.row_id = table2.row_id +1) ..
something in those lines. I hope this helps and give it a try and let me know if you need further guidance.
Pakki
---------------------------------------------------------------------------------
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply