stupid question - please beat me!!

Results 1 to 3 of 3

Thread: stupid question - please beat me!!

  1. #1
    Pinky Guest

    Default stupid question - please beat me!!

    I&#039;m simply trying to limit what is displayed from a database by the date MINUS 30 days. So I want to display based on 30 days prior to today.<BR><BR>I&#039;m doing this in a small stored procedure:<BR><BR>SELECT * FROM NewsBits<BR>WHERE NewsBits.NewsBitDate &#062;= Getdate() -30<BR>ORDER BY NewsBits.NBID ASC<BR><BR>There are 4 test-records in the database. The first three are set at 12/01/2000, the last is today&#039;s date - 02/27/2001 (in their own separate column in the DB - NewsBits.NewsBitDate)<BR><BR>Then I&#039;m simply listing the contents of the query on a page w/ a basic While, Wend loop.<BR><BR>Yet, I get no records. Forgive me, I&#039;m lame, I haven&#039;t coded any real asps in a few months now, I&#039;m rusty, and I just can&#039;t get over this hump.

  2. #2
    Join Date
    Dec 1969

    Default beating

    if you have an access db, then you need to put the #&#039;s around it should be <BR><BR>WHERE NewsBits.NewsBitDate &#062;= #" & date()-30 & "#<BR><BR>hope this helps!!

  3. #3
    Pinky Guest

    Default RE: beating

    Never access..always SQL Server...thanks anyways!

Posting Permissions

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