هواشناس
شنبه 18 مهر 1388, 12:21 عصر
بنام خدا
با سلام
دستور زير از sql رو چطوري اصلاح كنم جواب بده البته فقط قسمت شرط where ايراد داره
كه در اون StationCodes نام جدول و gdateنام فيلد از نوع shortdate و Mydate1 متغير تاريخ هست
به سه مدل نوشتم نشد:
StationCodes&"."&"gdate beetween '"&dateadd("yyyy",-1,cdate(MyDate1))&"'"&" and "&"'"&cdate(MyDate1)&"'"
StationCodes&"."&"gdate beetween '#"&dateadd("yyyy",-1,cdate(MyDate1))&"#'"&" and "&"'#"&cdate(MyDate1)&"#'"
StationCodes&"."&"gdate>=#"&dateadd("yyyy",-1,cdate(MyDate1))&"#"&" and "&StationCodes(0)&"."&"gdate<=#"&cdate(MyDate1)&"#"
اين هم ايرادش البته براي مدل اولي
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression '[40768].gdate beetween '2009/10/20' and '2010/10/20' and [90530].gdate beetween '2009/10/20' and '2010/10/20' and [40775].gdate beetween '2009/10/20' and '2010/10/20' and [40886].gdate beetween '2009/10/20' and '2010/10/20' and [99384].gdate beetween '200'.
با سلام
دستور زير از sql رو چطوري اصلاح كنم جواب بده البته فقط قسمت شرط where ايراد داره
كه در اون StationCodes نام جدول و gdateنام فيلد از نوع shortdate و Mydate1 متغير تاريخ هست
به سه مدل نوشتم نشد:
StationCodes&"."&"gdate beetween '"&dateadd("yyyy",-1,cdate(MyDate1))&"'"&" and "&"'"&cdate(MyDate1)&"'"
StationCodes&"."&"gdate beetween '#"&dateadd("yyyy",-1,cdate(MyDate1))&"#'"&" and "&"'#"&cdate(MyDate1)&"#'"
StationCodes&"."&"gdate>=#"&dateadd("yyyy",-1,cdate(MyDate1))&"#"&" and "&StationCodes(0)&"."&"gdate<=#"&cdate(MyDate1)&"#"
اين هم ايرادش البته براي مدل اولي
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression '[40768].gdate beetween '2009/10/20' and '2010/10/20' and [90530].gdate beetween '2009/10/20' and '2010/10/20' and [40775].gdate beetween '2009/10/20' and '2010/10/20' and [40886].gdate beetween '2009/10/20' and '2010/10/20' and [99384].gdate beetween '200'.