User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 391,601 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,606 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 511 | Replies: 2
Reply
Join Date: Apr 2008
Posts: 2
Reputation: HugoCore is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
HugoCore HugoCore is offline Offline
Newbie Poster

Filter the Filter

  #1  
Apr 28th, 2008
Hello ,

How can i filter something then turn it to filter again and one more time , like :

SELECT * FROM Tbl1 WHERE BLABLA1

From those results

WHERE BLABLA 2

And Finally , from all back results

WHERE BLABLA 3.

Real Example: Select all where : the year is between x and y, then the month is beetwen z and w, and finally, where the days is beetween v and t.

Dont Work:
  1. SELECT * FROM TABLE WHERE (FORMAT(datainicio, "dd") >= '01' AND FORMAT(datainicio, "dd") <= '19')
  2.  
  3. AND (FORMAT(datainicio, "mm") >= '01' AND FORMAT(datainicio, "mm") <= '04')
  4.  
  5. AND (FORMAT(datainicio, "yyyy") >= '2005' AND FORMAT(datainicio, "yyyy") <= '2009') ORDER BY

Ps. Can't use the Beetween because it's a char field

OPS: IN MS ACCCESS, MOVE THE POST IF NECESSARY

Regards, many regards.
Core
Last edited by peter_budo : May 3rd, 2008 at 6:06 pm. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Posts: 51
Reputation: Nige Ridd is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 9
Nige Ridd Nige Ridd is offline Offline
Junior Poster in Training

Re: Filter the Filter

  #2  
May 2nd, 2008
Wouldn't be much better and much more maintainable if you converted the values to a date datatype?
Nige
Reply With Quote  
Join Date: Dec 2004
Posts: 406
Reputation: Sulley's Boo will become famous soon enough Sulley's Boo will become famous soon enough 
Rep Power: 5
Solved Threads: 9
Sulley's Boo's Avatar
Sulley's Boo Sulley's Boo is offline Offline
Posting Pro in Training

Re: Filter the Filter

  #3  
May 5th, 2008
and ..

Your table name is 'table'?

-_-
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MS SQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 11:52 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC