Filtering by dates in SQL

Results 1 to 3 of 3

Thread: Filtering by dates in SQL

  1. #1
    Lalo Guest

    Default Filtering by dates in SQL

    Hi, I have 3 records:<BR><BR>Select * from products<BR><BR>Product P_Date<BR>1 2000-04-03 16:15:50.000<BR>2 2000-04-03 16:20:10.000<BR>3 2000-04-03 16:50:30.000<BR><BR>I need to make a select to show only the records between 16:15 and 16:20<BR><BR>Select * from products where P_date ?????? <BR>how I can filter this ....<BR>

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default RE: Filtering by dates in SQL

    R&D --&#062; convert(char(5),DateColName,108)<BR><BR>this will return the time what you will have to do is check for the date and then the time in your sqlquery or you can change the style.<BR><BR>i am assuming here that all you have is the time and want to retrieve the values. If it for a given date and you have the date and time then you can just do<BR><BR>where P_date &#062;= &#039FromDate&#039 and P_date &#060;= &#039ToDate&#039<BR><BR>

  3. #3
    lalo Guest

    Default Thanks for your help

    Best Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts