URGENT - DATE SQL

Results 1 to 2 of 2

Thread: URGENT - DATE SQL

  1. #1
    Join Date
    Dec 1969
    Posts
    34

    Default URGENT - DATE SQL

    i have a table with a date in it , and i need some SQL to extract all the records that have been added in the last 7 days.<BR>below is what i have but it doesnt span over months, is there any quick way round it like using datediff ???<BR><BR>tempdate =dateadd("d",-7,date)<BR>mySQL="select * from classifieds where month(DateSubmitted) =" & month(tempdate)& " and "<BR>mySQL = mysql & "year(DateSubmitted) = " & year(tempdate)& " and "<BR>mySQL = mysql & "day(DateSubmitted) &#062; " & day(tempdate)<BR>

  2. #2
    Jairo Guest

    Default RE: URGENT - DATE SQL

    Carlo,<BR><BR>mySQL = " select * from CLASSIFIEDS where datediff(dd, trans_date, getdate() ) &#060;= 7 "<BR><BR>HTH,<BR>Jairo<BR>http://www.citywebarchitects.com

Posting Permissions

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