Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 81
  • Last Modified:

syntax error in FROM clause

Hi i am using adodc4 control to print but getting error "Syntax error in FROM clause"
"BillSumry" is not table but its a query in access,

Please assist

    With Adodc4                    
         .RecordSource = "SELECT Invo_No,Date_Invo,Net_Amt,Pkg_Chg,Pkg_Amt,Comison,Tax_Amt,Loading,DiscOn FROM BillSumry"
        .Refresh
        
    End With
    
    With DataReport10
        
        Set .DataSource = Adodc4
        
        .Sections("Section2").Controls("Label3").Caption = Text2.Text
        .Show
    
    End With

Open in new window

0
crystal_Tech
Asked:
crystal_Tech
  • 2
  • 2
1 Solution
 
PatHartmanCommented:
Open the Access query editor in SQL view.  Paste in the SQL string and run the query.  Do you get any errors?  Does it prompt for a variable?

Does BillSummary take any arguments?
0
 
crystal_TechAuthor Commented:
Thanks for reply
No, Not getting any error, And no any prompt for variable..?
getting all data,
and this is the query,  BillSummary is not table but query in DB (Ms Access)
SELECT DISTINCT BillDtl.BillNo AS Invo_No, CFT_NEW.Date_Invo, BillDtl.NetAmt AS Net_Amt, BillDtl.PkgChg AS Pkg_Chg, BillDtl.PkgAmt AS Pkg_Amt, BillDtl.Commission AS Comison, BillDtl.TaxAmt AS Tax_Amt, BillDtl.Loading, BillDtl.DiscOn, BillDtl.DiscAmt, BillDtl.GrandTTL, BillDtl.BndlTTL, CFT_NEW.CustName
FROM BillDtl, CFT_NEW
WHERE BillDtl.BillNo=CFT_NEW.InvoNo;

Open in new window

and this is from VB code..as i mention in my question
"SELECT Invo_No,Date_Invo,Net_Amt,Pkg_Chg,Pkg_Amt,Comison,Tax_Amt,Loading,DiscOn FROM BillSumry"

Open in new window

0
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
What happens if you use Select *?
Also are you sure about the name of the query BillSumry?
0
 
PatHartmanCommented:
FROM BillDtl, CFT_NEW
is old fashioned syntax and in an Access query results in a Cartesian Product which among other issues is always not updateable.

Make the join specific by changing the where clause to a join.

FROM BillDtl Inner Join CFT_NEW ON BillDtl.BillNo = CFT_NEW.InvoNo;
0
 
crystal_TechAuthor Commented:
it works
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now