3
Answers

use of SUBSTRING function in WHERE clause using SQL SERVER 8

Suji D

Suji D

9y
669
1
Hi all,
   Good Day!  I am using SQL SERVER 2008 and Microsoft Visual Studio 2008.  In the i have a database table which contains a column for data and time as string. in that column i have both date and time. In my application i have to select date and based on that date i have to get the data from table and show in data grid view control. So i want to compare only with date. 
And i referred the below link. But it is not working for me.
 
 I tried this query, But not working for me.
SELECT * FROM tAerator WHERE SUBSTRING(fldAEdnt,0,10)='07-07-2015' 
 
 can you please give me way to solve this problem.
 
 
Thanks & Regards
Suji D 
Answers (3)
0
Anjali Khan

Anjali Khan

NA 738 42.2k 7y
Frnds
 
not copied table data only procedure n function
0
Laxmidhar Sahoo

Laxmidhar Sahoo

NA 2.3k 1.4k 7y
madam
 
follow the below procedure to take script
 
 
 
Choose the advance button from the bellow dialog box at the top
 
 
select schema and data from the dropdownlist in the bellow dialogbox of option
 
Type of data to script
 
 
0
Esakki Muthu

Esakki Muthu

NA 882 342 7y
If the SQL server versions are same then just take a backup of your database (.bak file) and retore it in the new system. OR 
While generating the scripts choose "Schema With Data" option