Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Location
    New York, NY
    Posts
    225

    Unanswered: Date() Function and SQL **Resolved**

    I am running a query using the MS Query Analyzer. I am inserting a large number of fields into a table, one of the fields is a date field where I enter the date (Hard Coded) that the query is run. I was wondering if it was possible to have the script get the date while it is running via the Date() function. I have tried the following:

    Code:
    Declare @DateVar SmallDateTime
    Set @DateVar = Date()
    I am getting an error on the second line, so I guess the Date() function is not native to SQL. So is there another way of accomplishing this?


    Thanks
    Last edited by Mark Gambo; 10-28-04 at 19:41.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    GetDate()

    -PatP

  3. #3
    Join Date
    May 2003
    Location
    New York, NY
    Posts
    225

    Talking

    Thanks Pat,
    I just found that same function and I was coming back to update my post when I saw that you already posted it, thanks!


    Mark

Posting Permissions

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