473,513 Members | 3,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parameterized Saved Sub Query

I have ASP
strSQL = "SELECT POSCat.Description , InnerJoinCategoryReport.Total"_
& "FROM POSCat LEFT JOIN InnerJoinCategoryReport ON
InnerJoinCategoryReport.Cat = POSCat.Description "
which references saved query InnerJoinCategoryReport
SELECT InvLine.Cat, Sum(InvLine.Price) AS Total
FROM Payments INNER JOIN ((InvLine INNER JOIN Invoice ON
InvLine.IId=Invoice.IId) INNER JOIN PaySplit ON
Invoice.IId=PaySplit.IId) ON Payments.PAYId=PaySplit.PayId
WHERE (((Invoice.Total)=Invoice.Paid) And ((Payments.PayDate) Between
[dtStartDate] And [dtEndDate] ))
GROUP BY InvLine.Cat
ORDER BY InvLine.Cat;
If I run this in access it asks for the dates as it is setup
parameterized and will run. But how can I write the ASP because my
paramerized query is a sub query if this makes any sence!?! Any help
would be great

Mar 23 '06 #1
2 1490
Tried this
strSQL = "SELECT POSCat.Description , InnerJoinCategoryReport.Total"_
& "FROM POSCat LEFT JOIN InnerJoinCategoryReport ON
InnerJoinCategoryReport.Cat = POSCat.Description " & dtStartDate & "',
'" & dtEndDate & "'"
Set Rs = ConnQuery.Execute(strSQL)

but get
Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression
'InnerJoinCategoryReport.TotalFROM POSCat LEFT JOIN
InnerJoinCategoryReport ON InnerJoinCategoryReport.Cat =
POSCat.Description '''.

Mar 23 '06 #2
tranceport185 wrote:
Tried this
strSQL = "SELECT POSCat.Description , InnerJoinCategoryReport.Total"_
& "FROM POSCat LEFT JOIN InnerJoinCategoryReport ON
InnerJoinCategoryReport.Cat = POSCat.Description " & dtStartDate & "',
'" & dtEndDate & "'"
Set Rs = ConnQuery.Execute(strSQL)

but get
Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression
'InnerJoinCategoryReport.TotalFROM POSCat LEFT JOIN
InnerJoinCategoryReport ON InnerJoinCategoryReport.Cat =
POSCat.Description '''.


You need a space between

InnerJoinCategoryReport.Total and FROM

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Mar 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6047
by: gary b | last post by:
Hello When I use a PreparedStatement (in jdbc) with the following query: SELECT store_groups_id FROM store_groups WHERE store_groups_id IS NOT NULL AND type = ? ORDER BY group_name
1
2060
by: Roger | last post by:
I've got a filter form to select customers, products, etc and these are used in parameter queries, ie WHERE t_cuno Like !! the parameter queries, roll up to a crosstab query, that is used to create an excel worksheet I use a queryDef structure to set the parameters, and that works fine now, I've got to change the customer selection,...
8
12905
by: deko | last post by:
I'm trying to open a Recordset based on a parameterized query. I'm kind of new to parameterized queries, so I'm sure I'm missing something simple. Set qdfs = db.QueryDefs Set qdf = qdfs("qryInvoices") qdf.Parameters("prmInv") = strInvoice qdf.Parameters("prmCid") = lngCustomerID Set rst = db.OpenRecordset("qryInvoices")
2
1849
by: deko | last post by:
Is it possible to build a parameterized query from another parameterized query? I've tried two variations of this and can't seem to get it to work (using DAO). Any suggestions welcome! I want to delete linked documents - but only if they are not linked to other entities outside of the category being deleted
11
3755
by: anony | last post by:
Hello, I can't figure out why my parameterized query from an ASP.NET page is dropping "special" characters such as accented quotes & apostrophes, the registered trademark symbol, etc. These symbols insert without problem from query analyzer, so that suggests it's something within ASP.NET. I've tried using .NET textbox web controls as well...
2
1472
by: JSheble | last post by:
After building a parameterized ADO query, is there a method or a statement where you could see the actual query, with the parameterized values included?? -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
7
6203
by: Mark | last post by:
Hello. I am developing an Access 2000 form, and I want to populate a databound list box using a saved query that requires parameters. Is there any way to do this? I tried creating a DAO querydef object and setting the parameters, and then assigned the querydef object to the list box "rowsource" property. This did not work. Thanks -Mark
8
8032
by: Roland Hall | last post by:
In Access you use "*" + + "*", + can be replaced with & Calling a parameterized query in Access requires % be used in place of *, however, all that I have read show dynamic SQL passed to Access: WHERE LIKE '" & ASPvar & "' % ORDER BY ... However, my call is similar to: conn.qMyLookup strVar, rs
3
2213
by: xlar54 | last post by:
Is there a way to see the exact SQL being generated from a parameterized query? I am using this technique but am getting some strange SQL errors during execution and I would like to see the final SQL that is being generated.
0
7269
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7394
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7559
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7123
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
4756
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3237
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.