I have a serious and confusing issues with DateTimePicker.
I have DateTimePicker where user can choose a date and make entry. I then record this entry into the database.
Problem: my application date shows 08-02-2012 (i.e 08 february 2012 in DTPicker value), when i select this and insert it to my database , the MS Access takes this as August, 2 2012, and records it as the same.
I could fix this by using this code:
Dim mydate As DateTime mydate = Me.dtpicker10.Value.ToShortDateString Dim output1 As String = Format(mydate, "MM-dd-yyy")
and pass sql insert query using
insert into table (mydate) VALUES (#" & output1 & "#)
instead of getting the value directly from the dtpicker. This fix the issues, but when i tried to get the date out of the database to filter it between entry made in certain date, i sometimes have problem
how do i generalize this for all type of client computers where the date and time settings can be any form.
What will be the best and more flawless ways of approach to target all types of clients?
Am i on the right track?? please advice from your experience
Edited 4 Years Ago by steplar: n/a