DateDiff

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ddtpmyra
    Contributor
    • Jun 2008
    • 333

    DateDiff

    Is there something wrong on this query?

    Code:
    SELECT * FROM filestorage WHERE DIFFDATE(deadlinefeedback,now())
    Im having below error on mysql query browser
    You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(deadlinefeedb ack,now())' at line 1
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    Is the DIFFDATE function a custom function you made?
    If not, then that would be your problem. MySQL does not have a function called DIFFDATE.

    Are you perhaps confusing it with the DATEDIFF function?

    Comment

    • ddtpmyra
      Contributor
      • Jun 2008
      • 333

      #3
      Sorry I mistype it it should be "DATEDIFF" and still with the same error. Strange.

      You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(deadlinefeedb ack,now())' at line 1

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        In that case, no. There doesn't appear to be anything wrong with the query.
        Are you sure this is exactly what is getting executed?

        Is it possible that there is some white-space or other junk character getting in between there?

        Another thing... the return value of the DATEDIFF function is the number of days between the two dates. But you use it like a boolean value. Is there a reason for this?

        Comment

        Working...