problem in select data from database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hamayun Khan
    New Member
    • Aug 2007
    • 106

    problem in select data from database

    hi

    I want to execute the following query against sql2005

    "SELECT tblregion.Regio n, tblJobPost.* FROM tblJobPost LEFT OUTER JOIN tblregion ON tblJobPost.regi on_id = tblregion.Regio nID Where
    day(tblJobPost. postdate)=day(d ate()) and month(tblJobPos t.postdate)=mon th(date()) and year(tblJobPost .postdate)=year (date())"
    this generate the following error

    'date' is not a recognized built-in function name.

    I m not an sql expert. I need query equivalent to the above
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    You need to use getdate() in place of date()

    Comment

    • kunal pawar
      Contributor
      • Oct 2007
      • 297

      #3
      In Sql server no data function is available, so there should be getdate() function for get current date

      refer this link
      http://msdn2.microsoft .com/en-us/library/ms186724.aspx

      Comment

      Working...