Re: Error syntax in Query SQL
- From: "Dmitriy Antonov" <antonovdima@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 2 Dec 2005 23:52:10 -0500
"RUDI HARSONO" <binapusat@xxxxxxxxxxx> wrote in message
news:%234JSaB89FHA.2036@xxxxxxxxxxxxxxxxxxxxxxx
> Dear all,
> I made application where is a part of code using SQL syntax with ADODB
> object. I get error message at SQL Statement when It used in other machine
> that was choose regional setting by Indonesia ( OS: Windows XP Profesional
> Edition SP2). look at following a piece of code:
>
> R.Open "SELECT COUNT('nWeek') AS nTotal FROM SettingDate WHERE
> ((StartDate <=#" _
> & dt & "#) AND (EndDate >=#" & dt & "#))", DBConTrans,
> adOpenForwardOnly, adLockOptimistic
>
> VB says any error at query date SELECT syntax but I tried to change
> choosing US(english) Regional Setting in Control Panel, it's no problem.
> Application run smoothly without any problem.
>
> Can anybody expalain what's a problem?. I will appriciate for your
> response.
>
>
> Regards
>
> Rudi H
In creation of your Select statement try to use "generic" date format:
YYYY-MM-DD. You can use Format function to do it.
Dmitriy.
.
- Follow-Ups:
- Re: Error syntax in Query SQL
- From: RUDI HARSONO
- Re: Error syntax in Query SQL
- References:
- Error syntax in Query SQL
- From: RUDI HARSONO
- Error syntax in Query SQL
- Prev by Date: Error syntax in Query SQL
- Next by Date: Re: Error syntax in Query SQL
- Previous by thread: Error syntax in Query SQL
- Next by thread: Re: Error syntax in Query SQL
- Index(es):
Relevant Pages
|