Results 1 to 2 of 2

Thread: dates

  1. #1
    Join Date
    Dec 1969

    Default dates

    hello....I have a field with a column called release date(11/20/2000); I would like to get all fields where release date mataches the present day date(eg."todays date") but there is no filed with todays date in that possible to do in a stored procedure<BR><BR>I&#039;m looking for something like this: <BR>"select * from table where release_date = now()"

  2. #2
    Join Date
    Dec 1969

    Default I don't think you are...

    ...looking for<BR> select * from table where release_date = now()<BR><BR>because then the field in the table would have to match the current date *AND* time to the *SECOND*.<BR><BR>But if you are looking for that, and if you are using SQL Server (you didn&#039;t bother to say what DB, you know), then you can simply do:<BR> select * from table where release_date = getDate()<BR><BR>because indeed the getDate() function in SQL Server is equivalent to Now() in VBS.<BR><BR>HOWEVER...<BR><BR>If what you *really* wanted was the equivalent of<BR> select * from table where release_date = DATE()<BR>then, unfortunately, in SQL Server it&#039;s a little more complex:<BR> select * from table <BR> where release_date = CONVERT( DATETIME, CONVERT( VARCHAR, getDate(), 102 ) )<BR><BR>Look here to see how/why that works: <BR><BR><BR>Might I suggest that you bookmark this page:<BR><BR><BR><BR><BR>

Posting Permissions

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