SQL Query
-
Hi, please can anyone let me know the date formats in sql server for this query. my table structure is" PDate PMonth PYear 10 05 2007 03 05 2004 12 10 2007 o1 12 2005 now i have to retrieve the records based on some specified dates. for example, i want the records which matches "12/10/2007" i know how to write the code for these 3 columns to format (mm/dd/yyyy)using C# & vb.Net but i want to know how to write using Tsql Thanks, Suketh
-
Hi, please can anyone let me know the date formats in sql server for this query. my table structure is" PDate PMonth PYear 10 05 2007 03 05 2004 12 10 2007 o1 12 2005 now i have to retrieve the records based on some specified dates. for example, i want the records which matches "12/10/2007" i know how to write the code for these 3 columns to format (mm/dd/yyyy)using C# & vb.Net but i want to know how to write using Tsql Thanks, Suketh
Hi Use the date functions like Month(), Day() and Year() to get month,date and year. Based on these functions you can filter records. For example Month(DateColumn) will display month of the given datecolumn Hope you got it... :)
Harini
-
Hi, please can anyone let me know the date formats in sql server for this query. my table structure is" PDate PMonth PYear 10 05 2007 03 05 2004 12 10 2007 o1 12 2005 now i have to retrieve the records based on some specified dates. for example, i want the records which matches "12/10/2007" i know how to write the code for these 3 columns to format (mm/dd/yyyy)using C# & vb.Net but i want to know how to write using Tsql Thanks, Suketh
-
Hi, please can anyone let me know the date formats in sql server for this query. my table structure is" PDate PMonth PYear 10 05 2007 03 05 2004 12 10 2007 o1 12 2005 now i have to retrieve the records based on some specified dates. for example, i want the records which matches "12/10/2007" i know how to write the code for these 3 columns to format (mm/dd/yyyy)using C# & vb.Net but i want to know how to write using Tsql Thanks, Suketh