Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: using an alias field name


Message #1 by Diane Roberts <Diane.Roberts@c...> on Mon, 21 Jan 2002 09:44:01 -0600
In other type of SQL programming I have been able to write a query which

assigns an alias to a calculated field and then uses that alias in the

Where clause to limit results.



For example



Select AcctNbr, BegBal-Payments as CurBal

From AccountMaster

Where CurBal > 1000



I can write a query like this in Access, but when I try to run it,

Access treats CurBal like a parameter and wants me to fill in a value.

Is there a trick to referencing calculated fields with aliases within a

query in Access?





--

CONFIDENTIALITY NOTICE



This message and any included attachments are from CashRetriever

Systems, Inc. (CSI), and are intended only for the parties identified

above.  The information contained in this message is confidential and

the unauthorized forwarding, printing, copying, distributing, or using

such information is strictly prohibited and may be unlawful.  If you

have received this transmission in error, please immediately notify the

sender by return email or by telephone at (205) 733-9925.





Message #2 by "John Ruff" <papparuff@c...> on Mon, 21 Jan 2002 08:08:32 -0800
This is a multi-part message in MIME format.



------=_NextPart_000_0001_01C1A252.D192A070

Content-Type: text/plain;

	charset="us-ascii"

Content-Transfer-Encoding: 7bit



You cannot use the alias in the where clause, you must use your fields

used to do the calculation.  Try this.



Select AcctNbr, BegBal-Payments as CurBal

From AccountMaster

Where BegBal-Payments > 1000







John Ruff - The Eternal Optimist J



 







-----Original Message-----

From: Diane Roberts [mailto:Diane.Roberts@c...]

Sent: Monday, January 21, 2002 7:44 AM

To: Access

Subject: [access] using an alias field name





In other type of SQL programming I have been able to write a query which

assigns an alias to a calculated field and then uses that alias in the

Where clause to limit results.



For example



Select AcctNbr, BegBal-Payments as CurBal

From AccountMaster

Where CurBal > 1000



I can write a query like this in Access, but when I try to run it,

Access treats CurBal like a parameter and wants me to fill in a value.

Is there a trick to referencing calculated fields with aliases within a

query in Access?





--

CONFIDENTIALITY NOTICE



This message and any included attachments are from CashRetriever

Systems, Inc. (CSI), and are intended only for the parties identified

above.  The information contained in this message is confidential and

the unauthorized forwarding, printing, copying, distributing, or using

such information is strictly prohibited and may be unlawful.  If you

have received this transmission in error, please immediately notify the

sender by return email or by telephone at (205) 733-9925.
























  Return to Index