SQL server

Comparing dates in SQL Server

Page 1 of 1

2 Replies - 923 Views - Last Post: 12 December 2008 - 10:08 PM Rate Topic: -----

#1 tina sunny  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 12-December 08

SQL server

Posted 12 December 2008 - 03:23 AM

Hi everyone....I'm using vb.net as my front end and SQL Server as the back end.I would like to get a pop up in my GUI which results from the comparison of dates.Can anyone help me out as to how to compare the present date with another date in SQL Server......thanks in advance.
Is This A Good Question/Topic? 0
  • +

Replies To: SQL server

#2 P4L  Icon User is offline

  • Your worst nightmare
  • member icon

Reputation: 34
  • View blog
  • Posts: 2,788
  • Joined: 07-February 08

Re: SQL server

Posted 12 December 2008 - 06:07 AM

Well, there are two different ways to do this. You can use
Where Now()=db.datefield


or
Where Date()=db.datefield



Now() will bring in the date/timestamp where as Date() will only bring in the year/month/day values.
Was This Post Helpful? 0
  • +
  • -

#3 tina sunny  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 12-December 08

Re: SQL server

Posted 12 December 2008 - 10:08 PM

Thanks P4L....sorry m very new to dis...can u be more specific as to where to write de code..
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1