how to get datetimepicker1.value from datetimepicker1.text

vb.net , sqlserver India
  • 12 years ago
    i have one dtpicker, i wanna search record from sql database which contain date in this format 19-feb-09 12:00:19 but here time is also come"12:00:19" so when i give query select * from abc where date='19-feb-09' result is Nothing and i wanna search by this datetimepicker.text (i.e 19-feb-09)
  • 12 years ago
    Hi, you might want to look into formatting the date that you compare against down to just the format you will receive in the datetime picker. also, in oracle, when we want to do work like that, we use the trunc command to strip the time off a date, not sure if it works the same on sqlserver, but something else you could look into. Si

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter” - Eric Raymond