SQL Server doesn't understand 'DateValue

Results 1 to 3 of 3

Thread: SQL Server doesn't understand 'DateValue

  1. #1
    Join Date
    Dec 1969
    Posts
    702

    Default SQL Server doesn't understand 'DateValue

    I&#039;ve been trying to check certain speed differences between SQL server and Access and found that my sql statement in access doesn&#039;t work for SQL server. I use a sql statement that looks for "Weekday(DateValue(whenvisited)) = 3". SQL server gives me an error of "DateValue is not a recognized function name" <BR><BR>Can you give me another way of doing the same thing? (basically I want to make sure that that date is a Monday)<BR><BR>Thanks John J

  2. #2
    Join Date
    Dec 1969
    Posts
    96,118

    Default It doesn't understand Weekday either

    Maybe a trip to the SQL Server docs will help?<BR><BR>http://msdn.microsoft.com/library/en-us/tsqlref/ts_fa-fz_2c1f.asp<BR><BR>You don&#039;t have lots of choices with SQL Server.<BR><BR>But I do have to ask: Why would you *need* DateValue in that expression??? Weekday(x) will work on a Date-with-time value just as well as it will work on a Date-alone value.<BR><BR>Anyway, investigate DATEPART in SQL Server, and think about the just prior paragraph here.<BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    702

    Default OK, Thanks for that. <eom>

    .

Posting Permissions

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