[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:

datetime

This is how I store my date in a table
2011-10-19 08:15:44.490

I want to query and get today's date only. Select *from mytable where Datereturned = getdate()  won't work.
0
VBdotnet2005
Asked:
VBdotnet2005
  • 2
1 Solution
 
Chandan_GowdaCommented:
--try this
 Select *from mytable where CONVART(VACRHAR,Datereturned,101) = CONVERT(VARCHAR,getdate() ,101)
0
 
Chandan_GowdaCommented:
--Sorry Typo error
--try this
 Select *from mytable where CONVERT(VARCHAR,Datereturned,101) = CONVERT(VARCHAR,getdate() ,101)
0
 
VBdotnet2005Author Commented:
that works. Thank you
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now