A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

SQL



 
 
Thread Tools Display Modes
  #1  
Old November 3rd, 2004, 07:06 AM
Wantula
external usenet poster
 
Posts: n/a
Default SQL

I decided to repost this question because the response i got didnt work, it
was giving me this error" Syntax error in the FROM clause".
Lynn Trap, thanks(atleast I have i have an idea), please give me another
syntax or check the syntax you gave me.

I have two SQL statements, one is giving me the total Quantity
available(from Stock table) and the other one is giving me the total number
of Quantity sold out.(from Sales Table). All these are GROUPED BY Item Name
e.g Handbags 3

Shoes 10
Is there a way of creating another SQL statement that will subtract the
Quantity sold from the total Quantity available so that I know the STOCK
REMAINING.
I need the syntax
  #2  
Old November 3rd, 2004, 09:00 AM
Evan Camilleri
external usenet poster
 
Posts: n/a
Default

1) Make sure in both queries you have StockCode

2) Make new query and insert both queries, link by StockCode

3) Add fields to query: StockCode, QtyAvail, QtySold, (QtyAvail-QtySold)


Evan Camilleri


"Wantula" wrote in message
...
I decided to repost this question because the response i got didnt work,
it
was giving me this error" Syntax error in the FROM clause".
Lynn Trap, thanks(atleast I have i have an idea), please give me another
syntax or check the syntax you gave me.

I have two SQL statements, one is giving me the total Quantity
available(from Stock table) and the other one is giving me the total
number
of Quantity sold out.(from Sales Table). All these are GROUPED BY Item
Name
e.g Handbags 3

Shoes 10
Is there a way of creating another SQL statement that will subtract the
Quantity sold from the total Quantity available so that I know the STOCK
REMAINING.
I need the syntax



  #3  
Old November 3rd, 2004, 05:16 PM
Lynn Trapp
external usenet poster
 
Posts: n/a
Default

Can you post the exact SQL statement you tried so someone here can see what
the syntax error might be?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"Wantula" wrote in message
...
I decided to repost this question because the response i got didnt work,

it
was giving me this error" Syntax error in the FROM clause".
Lynn Trap, thanks(atleast I have i have an idea), please give me another
syntax or check the syntax you gave me.

I have two SQL statements, one is giving me the total Quantity
available(from Stock table) and the other one is giving me the total

number
of Quantity sold out.(from Sales Table). All these are GROUPED BY Item

Name
e.g Handbags 3

Shoes 10
Is there a way of creating another SQL statement that will subtract the
Quantity sold from the total Quantity available so that I know the STOCK
REMAINING.
I need the syntax



  #4  
Old November 9th, 2004, 12:57 AM
David Seeto via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

I've replied to Wantula's question in what I suspect is his original post - please don't post twice, as it gets confusing. You'd be much better off finding your original post and adding a new comment to it - then, people can see everyone's comments.

I think the problem here is that you're trying to do the whole thing in one step. I suspect it's possible, but it would lead to a very complex SQL statement. I personally think you would be better off saving your two SELECT statements as individual queries and then, as the others here and I suggest in the other thread, Join those and do your calculation there.

*****************************************
* A copy of the whole thread can be found at:
* http://www.accessmonster.com/Uwe/For...sdbdesign/6300
*
* Report spam or abuse by clicking the following URL:
* http://www.accessmonster.com/Uwe/Abu...a3d781fef5872e
*****************************************
 




Thread Tools
Display Modes

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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is Access SQL FROM Clause different from MS SQL Server SQL? David Perkins Running & Setting Up Queries 1 October 20th, 2004 08:26 PM
Inconsistent square bracket in Query SQL Christine Running & Setting Up Queries 8 October 7th, 2004 03:49 AM
Why is no one USING the product for small business? jayceejay New Users 11 September 15th, 2004 12:46 AM
Using sql insert with memo field truncates text data Graham Meredith General Discussion 1 September 1st, 2004 03:11 AM
Function isn't available in expressions in query expression Reiner Harmgardt General Discussion 4 July 21st, 2004 09:30 AM


All times are GMT +1. The time now is 05:59 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.