|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
SQL Query Error
Hi,
I have this query: SELECT fulllist.list, COUNT(appold.reason) AS CountofReasons FROM {oj fulllist LEFT OUTER JOIN appold ON (fulllist.list = appold.reason)} WHERE ((((appold.monthentry = 4) OR appold.monthentry IS NULL) AND (fulllist.list <> ' ')) AND 1=1) GROUP BY fulllist.list which works fine in Dreamweaver Recordset Query box, but when I add it to the page as : <% Session.LCID=2057 Session.Abandon Response.Expires = -1440 Response.CacheControl = "private" Response.buffer = true Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "no-cache" Response.Expires = -1 Set Connection= Server.CreateObject ("ADODB.connection") Connection.Provider= "Microsoft.Jet.OLEDB.4.0" Connection.Properties ("Data Source")= Server.MapPath ("dbsla.mdb") Connection.Open Set RStellers=Server.CreateObject("ADODB.recordset") RStellers.Open "SELECT fulllist.list, COUNT(appold.reason) AS CountofReasons FROM {oj fulllist LEFT OUTER JOIN appold ON (fulllist.list = appold.reason)} WHERE ((((appold.monthentry = 4) OR appold.monthentry IS NULL) AND (fulllist.list <> ' ')) AND 1=1) GROUP BY fulllist.list;", Connection, 3 Set RStellers=nothing Connection.close Set Connection=nothing %> I get an error: Error Type: Microsoft JET Database Engine (0x80040E14) Syntax error in FROM clause. /dbsla/reasonsg.asp, line 138 Does any one know whats wrong? Thanks, Sanjay |
|
#2
|
|||
|
|||
|
remove the {oj } code, i.e.
Code:
RStellers.Open "SELECT fulllist.list, COUNT(appold.reason) AS CountofReasons FROM fulllist LEFT OUTER JOIN appold ON (fulllist.list = appold.reason) WHERE ((((appold.monthentry = 4) OR appold.monthentry IS NULL) AND (fulllist.list <> ' ')) AND 1=1) GROUP BY fulllist.list",Connection,3 |
|
#3
|
|||
|
|||
|
Thanks swampBoogie,
That's sorted the problem out! Cheers, Sanjay |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > SQL Query Error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|