By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,884 Members | 949 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,884 IT Pros & Developers. It's quick & easy.

error to converting datetime format into character string

P: 1
hi
i have make a report with mshflexgrid. the report between two date. when i have written query

.open"select * from tablename where t_date>=convert(datetime,' " & text1.text &"') and t2_date>=convert(datetime,' " & text2.text &"'),cn,,,adcmdtext


but there is a syntex error to converting datetime format into character string

plz help me

give me solution for the same

thanks

jignesh
Jun 16 '07 #1
Share this Question
Share on Google+
2 Replies


pureenhanoi
100+
P: 175
hi
i have make a report with mshflexgrid. the report between two date. when i have written query

.open"select * from tablename where t_date>=convert(datetime,' " & text1.text &"') and t2_date>=convert(datetime,' " & text2.text &"'),cn,,,adcmdtext


but there is a syntex error to converting datetime format into character string

plz help me

give me solution for the same

thanks

jignesh
If u ensure that the data u typed into Text1 and Text2 are exactly DateTime value, so u no need to use convert function. Use following SQL statement
[PHP].open "SELECT * FROM tablename WHERE t_date>=#" & text1.text & "# AND t2_date>=#" & text2.text & "#"[/PHP]
If u not ensure those data are datetime value, so u must check the data first by using isDate() function
Jun 16 '07 #2

hariharanmca
100+
P: 1,977
hi
i have make a report with mshflexgrid. the report between two date. when i have written query

.open"select * from tablename where t_date>=convert(datetime,' " & text1.text &"') and t2_date>=convert(datetime,' " & text2.text &"'),cn,,,adcmdtext


but there is a syntex error to converting datetime format into character string

plz help me

give me solution for the same

thanks

jignesh

first you have to define which database and getting date in Textbox is not good. Use DTPicker
Jun 16 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.