Click here to Skip to main content
12,295,294 members (59,463 online)
Rate this:
 
Please Sign up or sign in to vote.
Hi,

I have a table with the following structure

Id(pk),regid,secid,pkid,ad1,ad2,ad3,ip,status,statusdate

I want to select rows if it is available on all the given period for example, if i give 11-02-2013 and 17-02-2013, it will retrieve rows, if is available on each date between 11-02-2013 and 17-02-2013.

Please help me with the select query

regards
Posted 16-Feb-13 21:17pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Use between :
select * from [tablename] where statusdate between '2013-02-11' and '2013-02-17'
  Permalink  
Comments
Ahamed Azeem 17-Feb-13 3:24am
   
Hi Mehdi,

it will select all the rows, i know this but I want to select rows only if is available on each date between 11-02-2013 and 17-02-2013.
Mehdi Gholam 17-Feb-13 3:25am
   
Your comment makes no sense, explain more.
Ahamed Azeem 17-Feb-13 3:25am
   
i want to if the particular IP is available on all the each date between 11-02-2013 to 17-02-2013

Hope you got my point
Mehdi Gholam 17-Feb-13 3:27am
   
... where ip = 'xxxxx' and statusdate between ...
Ahamed Azeem 17-Feb-13 3:29am
   
I want to group the rows by IP if its available on each date beween 11-02-2013 and 17-02-2013, I wont give ip as the parameter but only the date. It should not retrive the row if its available on one day and not in another day.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160525.2 | Last Updated 17 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100