473,387 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to query database with multiple queries


I have the following fieldname in an Access_Table:

Field 1 = Cust_ID (Primary key)
Field 2 = Date
Field 3 = Description
Field 4 = Inv_No
Field 5 = Amount

My SQL Input syntax are:

"Select distinct Cust_ID,Date,Description,Inv_No,Amount from
Access_Table WHERE Date <Now()-30 And Date >Now()-60 AND Date =
Main.Date"

It failed to generate the result I want,anyway

My "Required" Output is:

Cust_ID Date Description Inv_No >30DYS >60DYS
8000 21/05/2004 PC RAM 200
8000 26/06/2004 Modem 180
---------------------------------------------------------------
Total: 180 200
---------------------------------------------------------------

8001 22/04/2004 Cable 50
8001 23/05/2004 HD 210
---------------------------------------------------------------
Total: 260
---------------------------------------------------------------
Grand Total: 180 460
can anyone help? Thanks
From:Cady Steldyn

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
1 1062
Hi

You seem to have posted 3 very similar requests. Please see reply to
"SQL-Query Access by Date"

John

"Cady Steldyn" <dc*******@yahoo.ca> wrote in message
news:41**********************@news.newsgroups.ws.. .

I have the following fieldname in an Access_Table:

Field 1 = Cust_ID (Primary key)
Field 2 = Date
Field 3 = Description
Field 4 = Inv_No
Field 5 = Amount

My SQL Input syntax are:

"Select distinct Cust_ID,Date,Description,Inv_No,Amount from
Access_Table WHERE Date <Now()-30 And Date >Now()-60 AND Date =
Main.Date"

It failed to generate the result I want,anyway

My "Required" Output is:

Cust_ID Date Description Inv_No >30DYS >60DYS
8000 21/05/2004 PC RAM 200
8000 26/06/2004 Modem 180
---------------------------------------------------------------
Total: 180 200
---------------------------------------------------------------

8001 22/04/2004 Cable 50
8001 23/05/2004 HD 210
---------------------------------------------------------------
Total: 260
---------------------------------------------------------------
Grand Total: 180 460
can anyone help? Thanks
From:Cady Steldyn

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 20 '05 #2

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

Similar topics

4
by: DG | last post by:
Hi, Can anyone advise how to execute multiple statements in a single query batch. For example- update customers set customer_name = 'Smith' where customer_name = 'Smyth'; select * from...
1
by: Jeremy | last post by:
I have built a form that calls queries. I have the first 2 set up as select queries, and the third set up as a make table query. When multiple users are on this application at the same time, they...
4
by: Nicolae Fieraru | last post by:
Hi All, I have a Table1 with ID, Name, Address, Purchase. I want to build a query which shows all the records from Table1 (only fields ID, Name, Address), but there shouldn't be listed records...
6
by: Martin Lacoste | last post by:
Ok, before I headbutt the computer... don't know why when I add criteria in a query, I get an 'invalid procedure call'. I also don't know why after searching the help in access, the various access...
1
by: fong.yang | last post by:
I've got a database with about 300,000 records. There are several different tables that are set up the same way with identical fields. I have the same queries individually set up for each table. ...
4
by: Eric | last post by:
I am trying to get the technician contractor(TECHCONT) of last field technician (FS_TechID or LstVldTech). It could be in Tbl_ValidDispute or Tbl_PPVResearch. In table Tbl_PPVResearch first i...
7
by: Daz | last post by:
Hi. I am trying to select data from two separate MySQL tables, where I cannot use join, but when I put the two select queries into a single query, I get an error telling me to check my syntax. Both...
0
by: Chuck36963 | last post by:
Hi all, I've been working on a listing problem and I can't figure out how to work it out. I have looked far and wide on the web to find answers, but I'd like other peoples input on my project in...
12
by: bhipwell via AccessMonster.com | last post by:
Hello, I have hit the "Cannot open any more databases" and "System resource exceeded" errors. Knew this was coming, but as I got closer to finishing the database, I hoped it wouldn't be an...
4
by: hapnendad | last post by:
In the question statement below Field names are in and variables are in (). All fields referenced are in what I have named the ‘PAR’ Table. Using MS Access 2003, I am working on a project...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.