Re: Error syntax in Query SQL




"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.


.



Relevant Pages

  • Re: Error syntax in Query SQL
    ... 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: ...
    (microsoft.public.vb.database)
  • Error syntax in Query SQL
    ... 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: ... VB says any error at query date SELECT syntax but I tried to change choosing USRegional Setting in Control Panel, ...
    (microsoft.public.vb.database)
  • Re: newbie - get memory error message when close .exe
    ... I get no error message when I click the "X" at top right ... > window to close on my laptop running XP, ... > a recordset and use a sql statement to populate the flexgrid. ... >> Veign's Resource Center ...
    (microsoft.public.vb.general.discussion)
  • Re: 2 table Query Error
    ... Post the SQL statement of the query that is giving you this error. ... It is a Country club member accounting database. ... > member ID to member ID) I get the afore memtioned error message. ...
    (microsoft.public.access.queries)
  • Re: Visual Studio Incorrect Syntax Near The Keyword Default Information
    ... as you haven't shown us the SQL statement it's difficult to say what the ... > I have got a error message while I run a sample OLEDB program. ... > says "Incorrect Syntax Near The Keyword Default Information". ... somebody says the reason is the database file size up ...
    (microsoft.public.dotnet.framework.aspnet)