Results 1 to 4 of 4

Thread: correct use of date functions in a constraint?

  1. #1
    Join Date
    Dec 2003
    Location
    UK
    Posts
    5

    correct use of date functions in a constraint?

    I am using the QueryAnalyzer and am stuck on this simple constraint, ive looked at many examples of these functions in books and my syntax seems fine. Yet I have been returned the error

    Line 38: Incorrect syntax near ','.

    from my constraint:

    constraint validate check ((recorddate !< (DATEADD(dd, -14, GETDATE()))),

    the following line is another constraint with no problems. I know its something to do with my brackets before the ',' but no matter how many I use I am returned the same error

  2. #2
    Join Date
    Mar 2003
    Posts
    468
    i think you will need to post the full constraint as your 5 '(' don't match the 4 ')' and a "," signifies there is something following that we can not see.

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    Please post the complete SQL statement.

  4. #4
    Join Date
    Dec 2003
    Location
    UK
    Posts
    5
    its ok now thanks for your interest guys. it was a minor syntax error.

    i dont suppose you could just tell me how to list all records for a particular 'family_no' in a table after a specific date? in the form of a query. assuming that record_date and family_no are 2 of the columns of this table.

Posting Permissions

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