dd/mm/yyyy
-
hi, anyone know how to search the date by "dd/mm/yyyy" in sql query! my code is : Select datamonth from datemonthtest where datamonth >= #" & strdatefrom & "# and datamonth <=#" & strdateto "# and data type i set it to date/time! The result is not efficient to select the month! Example: when i select the date is from 01/10/2006 to date 30/10/2006 but all the previous month will be come out! 09/08/2006...... Please help!
-
hi, anyone know how to search the date by "dd/mm/yyyy" in sql query! my code is : Select datamonth from datemonthtest where datamonth >= #" & strdatefrom & "# and datamonth <=#" & strdateto "# and data type i set it to date/time! The result is not efficient to select the month! Example: when i select the date is from 01/10/2006 to date 30/10/2006 but all the previous month will be come out! 09/08/2006...... Please help!
I thnk DATEPART is what you need, perhaps.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
hi, anyone know how to search the date by "dd/mm/yyyy" in sql query! my code is : Select datamonth from datemonthtest where datamonth >= #" & strdatefrom & "# and datamonth <=#" & strdateto "# and data type i set it to date/time! The result is not efficient to select the month! Example: when i select the date is from 01/10/2006 to date 30/10/2006 but all the previous month will be come out! 09/08/2006...... Please help!
-
Most likely due to the date format that you are using. The database is probably expecting the format "MM/dd/yyyy". You should use an unambigous date format like ISO 8601 ("yyyy-MM-dd"), or better yet, parameterised queries.
--- b { font-weight: normal; }
use "yyyy-MM-dd" + " 00:00:00 Between "yyyy-MM-dd" + " 23:59:59 " Format
Ravikumar [Coimbatore]
-
hi, anyone know how to search the date by "dd/mm/yyyy" in sql query! my code is : Select datamonth from datemonthtest where datamonth >= #" & strdatefrom & "# and datamonth <=#" & strdateto "# and data type i set it to date/time! The result is not efficient to select the month! Example: when i select the date is from 01/10/2006 to date 30/10/2006 but all the previous month will be come out! 09/08/2006...... Please help!