Hi
I get an ODBC ERROR - Incorrect syntax near , from crystal reports 8.5. any
help is realy appreciated
SELECT
National_Oxygen_Pte_Ltd_Customer_Budget."Customer No_",
National_Oxygen_Pte_Ltd_Customer_Budget."Mar Amount",
National_Oxygen_Pte_Ltd_Customer_Budget."Item Category Code",
FROM
"nox"."dbo"."National Oxygen Pte Ltd$Customer Budget"
National_Oxygen_Pte_Ltd_Customer_Budget
WHERE
(National_Oxygen_Pte_Ltd_Customer_Budget
."Customer No_" ,
National_Oxygen_Pte_Ltd_Customer_Budget."Item Category Code") NOT IN (SELEC
T
National_Oxygen_Pte_Ltd_Sales Invoice_Line."Customer No_",
National_Oxygen_Pte_Ltd_Sales_Invoice_Li
ne."Item Category Code" FROM
"nox"."dbo"."National Oxygen Pte Ltd$Sales Invoice Line"
National_Oxygen_Pte_Ltd_Sales_invoice_li
ne WHERE
National_Oxygen_Pte_Ltd_Sales_invoice_li
ne."Shipment Date" >= {ts
'2005-03-01 00:00:00.00'} AND
National_Oxygen_Pte_Ltd_Sales_invoice_li
ne."Shipment Date" < {ts '2005-03-3
1
00:00:01.00'}Hi Radha
Just try this way
SELECT
National_Oxygen_Pte_Ltd_Customer_Budget.[Customer No_],
National_Oxygen_Pte_Ltd_Customer_Budget.[Mar Amount],
National_Oxygen_Pte_Ltd_Customer_Budget.[Item Category Code],
FROM
nox.dbo.[National Oxygen Pte Ltd$Customer Budget]
National_Oxygen_Pte_Ltd_Customer_Budget
WHERE
(National_Oxygen_Pte_Ltd_Customer_Budget
.[Customer No_] ,
National_Oxygen_Pte_Ltd_Customer_Budget.[Item Category Code]) NOT IN (SELEC
T
National_Oxygen_Pte_Ltd_Sales Invoice_Line.[Customer No_],
National_Oxygen_Pte_Ltd_Sales_Invoice_Li
ne.[Item Category Code] FROM
nox.dbo.[National Oxygen Pte Ltd$Sales Invoice Line]
National_Oxygen_Pte_Ltd_Sales_invoice_li
ne WHERE
National_Oxygen_Pte_Ltd_Sales_invoice_li
ne.[Shipment Date] >= {ts
'2005-03-01 00:00:00.00'} AND
National_Oxygen_Pte_Ltd_Sales_invoice_li
ne.[Shipment Date] < {ts '2005-03-3
1
00:00:01.00'}
please let me know if there are any issues
thanks and regards
Chandra
"Radharaj" wrote:
> Hi
> I get an ODBC ERROR - Incorrect syntax near , from crystal reports 8.5. an
y
> help is realy appreciated
> SELECT
> National_Oxygen_Pte_Ltd_Customer_Budget."Customer No_",
> National_Oxygen_Pte_Ltd_Customer_Budget."Mar Amount",
> National_Oxygen_Pte_Ltd_Customer_Budget."Item Category Code",
> FROM
> "nox"."dbo"."National Oxygen Pte Ltd$Customer Budget"
> National_Oxygen_Pte_Ltd_Customer_Budget
> WHERE
> (National_Oxygen_Pte_Ltd_Customer_Budget
."Customer No_" ,
> National_Oxygen_Pte_Ltd_Customer_Budget."Item Category Code") NOT IN (SEL
ECT
> National_Oxygen_Pte_Ltd_Sales Invoice_Line."Customer No_",
> National_Oxygen_Pte_Ltd_Sales_Invoice_Li
ne."Item Category Code" FROM
> "nox"."dbo"."National Oxygen Pte Ltd$Sales Invoice Line"
> National_Oxygen_Pte_Ltd_Sales_invoice_li
ne WHERE
> National_Oxygen_Pte_Ltd_Sales_invoice_li
ne."Shipment Date" >= {ts
> '2005-03-01 00:00:00.00'} AND
> National_Oxygen_Pte_Ltd_Sales_invoice_li
ne."Shipment Date" < {ts '2005-03
-31
> 00:00:01.00'}|||That won't do if you're hitting against sqlserver.
Sqlserver does not support row constructors so such query will fail.
Try this instead:
SELECT
National_Oxygen_Pte_Ltd_Customer_Budget."Customer No_",
National_Oxygen_Pte_Ltd_Customer_Budget."Mar Amount",
National_Oxygen_Pte_Ltd_Customer_Budget."Item Category Code",
FROM
"nox"."dbo"."National Oxygen Pte Ltd$Customer Budget"
National_Oxygen_Pte_Ltd_Customer_Budget
WHERE NOT exists (SELECT *
FROM "nox"."dbo"."National Oxygen Pte Ltd$Sales Invoice Line"
National_Oxygen_Pte_Ltd_Sales_invoice_li
ne
WHERE
National_Oxygen_Pte_Ltd_Sales Invoice_Line."Customer
No_" =National_Oxygen_Pte_Ltd_Customer_Budget
."Customer No_"
AND National_Oxygen_Pte_Ltd_Sales_Invoice_Li
ne."Item Category
Code" =National_Oxygen_Pte_Ltd_Customer_Budget
."Item Category Code"
AND National_Oxygen_Pte_Ltd_Sales_invoice_li
ne."Shipment Date" >= {ts
'2005-03-01 00:00:00.00'} AND
National_Oxygen_Pte_Ltd_Sales_invoice_li
ne."Shipment Date" < {ts
'2005-03-31 00:00:01.00'}
-oj
"Chandra" <Chandra@.discussions.microsoft.com> wrote in message
news:F136E31C-9006-4817-B854-A0AB994F5E8C@.microsoft.com...
> Hi Radha
> Just try this way
> SELECT
> National_Oxygen_Pte_Ltd_Customer_Budget.[Customer No_],
> National_Oxygen_Pte_Ltd_Customer_Budget.[Mar Amount],
> National_Oxygen_Pte_Ltd_Customer_Budget.[Item Category Code],
> FROM
> nox.dbo.[National Oxygen Pte Ltd$Customer Budget]
> National_Oxygen_Pte_Ltd_Customer_Budget
> WHERE
> (National_Oxygen_Pte_Ltd_Customer_Budget
.[Customer No_] ,
> National_Oxygen_Pte_Ltd_Customer_Budget.[Item Category Code]) NOT IN
> (SELECT
> National_Oxygen_Pte_Ltd_Sales Invoice_Line.[Customer No_],
> National_Oxygen_Pte_Ltd_Sales_Invoice_Li
ne.[Item Category Code] FROM
> nox.dbo.[National Oxygen Pte Ltd$Sales Invoice Line]
> National_Oxygen_Pte_Ltd_Sales_invoice_li
ne WHERE
> National_Oxygen_Pte_Ltd_Sales_invoice_li
ne.[Shipment Date] >= {ts
> '2005-03-01 00:00:00.00'} AND
> National_Oxygen_Pte_Ltd_Sales_invoice_li
ne.[Shipment Date] < {ts
> '2005-03-31
> 00:00:01.00'}
> please let me know if there are any issues
> thanks and regards
> Chandra
>
> "Radharaj" wrote:
>|||Hi Chandra
Thanks for your response. However I am still getting the same error message
Regards
Raj
"Chandra" wrote:
> Hi Radha
> Just try this way
> SELECT
> National_Oxygen_Pte_Ltd_Customer_Budget.[Customer No_],
> National_Oxygen_Pte_Ltd_Customer_Budget.[Mar Amount],
> National_Oxygen_Pte_Ltd_Customer_Budget.[Item Category Code],
> FROM
> nox.dbo.[National Oxygen Pte Ltd$Customer Budget]
> National_Oxygen_Pte_Ltd_Customer_Budget
> WHERE
> (National_Oxygen_Pte_Ltd_Customer_Budget
.[Customer No_] ,
> National_Oxygen_Pte_Ltd_Customer_Budget.[Item Category Code]) NOT IN (SEL
ECT
> National_Oxygen_Pte_Ltd_Sales Invoice_Line.[Customer No_],
> National_Oxygen_Pte_Ltd_Sales_Invoice_Li
ne.[Item Category Code] FROM
> nox.dbo.[National Oxygen Pte Ltd$Sales Invoice Line]
> National_Oxygen_Pte_Ltd_Sales_invoice_li
ne WHERE
> National_Oxygen_Pte_Ltd_Sales_invoice_li
ne.[Shipment Date] >= {ts
> '2005-03-01 00:00:00.00'} AND
> National_Oxygen_Pte_Ltd_Sales_invoice_li
ne.[Shipment Date] < {ts '2005-03
-31
> 00:00:01.00'}
> please let me know if there are any issues
> thanks and regards
> Chandra
>
> "Radharaj" wrote:
>|||Hii oj
thanks a ton!! It works
Regards
Raj
"oj" wrote:
> That won't do if you're hitting against sqlserver.
> Sqlserver does not support row constructors so such query will fail.
> Try this instead:
> SELECT
> National_Oxygen_Pte_Ltd_Customer_Budget."Customer No_",
> National_Oxygen_Pte_Ltd_Customer_Budget."Mar Amount",
> National_Oxygen_Pte_Ltd_Customer_Budget."Item Category Code",
> FROM
> "nox"."dbo"."National Oxygen Pte Ltd$Customer Budget"
> National_Oxygen_Pte_Ltd_Customer_Budget
> WHERE NOT exists (SELECT *
> FROM "nox"."dbo"."National Oxygen Pte Ltd$Sales Invoice Line"
> National_Oxygen_Pte_Ltd_Sales_invoice_li
ne
> WHERE
> National_Oxygen_Pte_Ltd_Sales Invoice_Line."Customer
> No_" =National_Oxygen_Pte_Ltd_Customer_Budget
."Customer No_"
> AND National_Oxygen_Pte_Ltd_Sales_Invoice_Li
ne."Item Category
> Code" =National_Oxygen_Pte_Ltd_Customer_Budget
."Item Category Code"
> AND National_Oxygen_Pte_Ltd_Sales_invoice_li
ne."Shipment Date" >= {ts
> '2005-03-01 00:00:00.00'} AND
> National_Oxygen_Pte_Ltd_Sales_invoice_li
ne."Shipment Date" < {ts
> '2005-03-31 00:00:01.00'}
> --
> -oj
>
> "Chandra" <Chandra@.discussions.microsoft.com> wrote in message
> news:F136E31C-9006-4817-B854-A0AB994F5E8C@.microsoft.com...
>
>|||Dear Oj
Thanks a ton!! It works
Regards
Raj
"oj" wrote:
> That won't do if you're hitting against sqlserver.
> Sqlserver does not support row constructors so such query will fail.
> Try this instead:
> SELECT
> National_Oxygen_Pte_Ltd_Customer_Budget."Customer No_",
> National_Oxygen_Pte_Ltd_Customer_Budget."Mar Amount",
> National_Oxygen_Pte_Ltd_Customer_Budget."Item Category Code",
> FROM
> "nox"."dbo"."National Oxygen Pte Ltd$Customer Budget"
> National_Oxygen_Pte_Ltd_Customer_Budget
> WHERE NOT exists (SELECT *
> FROM "nox"."dbo"."National Oxygen Pte Ltd$Sales Invoice Line"
> National_Oxygen_Pte_Ltd_Sales_invoice_li
ne
> WHERE
> National_Oxygen_Pte_Ltd_Sales Invoice_Line."Customer
> No_" =National_Oxygen_Pte_Ltd_Customer_Budget
."Customer No_"
> AND National_Oxygen_Pte_Ltd_Sales_Invoice_Li
ne."Item Category
> Code" =National_Oxygen_Pte_Ltd_Customer_Budget
."Item Category Code"
> AND National_Oxygen_Pte_Ltd_Sales_invoice_li
ne."Shipment Date" >= {ts
> '2005-03-01 00:00:00.00'} AND
> National_Oxygen_Pte_Ltd_Sales_invoice_li
ne."Shipment Date" < {ts
> '2005-03-31 00:00:01.00'}
> --
> -oj
>
> "Chandra" <Chandra@.discussions.microsoft.com> wrote in message
> news:F136E31C-9006-4817-B854-A0AB994F5E8C@.microsoft.com...
>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment