SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 28th, 2004, 04:02 AM
fdtoo fdtoo is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 3 fdtoo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question SQL-Additional fields

a)SQL-Additional fields

Hi - hopefully this is an easy query for any experts out there!
I need to query a Microsoft Access database with the following fields

Field 1-Invoice_Date
Field 2-OrderNo
Field 3-CustomerName
Field 4-Invoice_Amount


1)Can I extract CustomerName, Invoice_Amount and OrderNo where the Invoice_Date is more
than 30 days and 60 days old (overdue from date of invoice) as below:


CustomerName |OrderNo | > 30 DYS | > 60 DYS | Total
---------------------------------------------------------
ShopMart |A1200 | 2,000 | 100 | 2,100
Handyware |CF002 | 5,200 | 200 | 5,400
---------------------------------------------------------
| Total | 7,200 | 300 | 7,500
================================================== =======



b)SQL-Query Access by Date

I need to query a Microsoft Access database with the following fields

Field 1-Date
Field 2-ItemCode
Field 3-Stock_In_qty
Field 4-Stock_Out_qty

1)Can I extract the following info that has an additional field that display
the quantity balance as below:

Date | ItemCode | Stock_In_qty | Stock_Out_qty | *Bal_qty
------------------------------------------------------------------

12/10/2003 | A100 | 20 | 0 | 20
25/10/2003 | A100 | 0 | 10 | 10
29/10/2003 | A100 | 15 | 0 | 25

10/11/2003 | A100 | 0 | 10 | 15
12/11/2003 | A100 | 2 | 0 | 17
22/11/2003 | A100 | 0 | 5 | 12

02/12/2003 | A100 | 20 | 0 | 32
30/12/2003 | A100 | 0 | 2 | 30

16/01/2004 | A100 | 20 | 0 | 50

05/02/2004 | B100 | 150 | 0 | 150
17/02/2004 | B100 | 0 | 50 | 100



2)Can I extract the following info that show the monthly *stock balance as below:


Period Oct03 | Nov03 | Dec03 | Jan04 | Feb04 | Total
------------------------------------------------------------
ItemCode
A100 25 | 12 | 30 | 50 | 0 | 117
B100 0 | 0 | 0 | 0 | 100 | 100
----------------------------------------------
25 | 12 | 30 | 50 | 100 | 217
==============================================

*Note:stock balance is the quantity balance at the end of each month

can anyone help? Thanks
Fromebbie

Reply With Quote
  #2  
Old September 1st, 2004, 01:31 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Sounds like a homework assignment

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > SQL-Additional fields


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT