|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Wednesday, July 15, 2009 8:43 AM
Points: 25,
Visits: 55
|
|
I'm sure my terminalogy is incorrect, but I will attempt to explain: I have an Access front-end with an SQL Database backend. In Access I created a Stored Procedure using fields from the Datbase Tables. I then needed to create a Field using a formula : [PD Time]/86400 , and entered an Alias as PDT.. Everything works. Then I want to use the PDT for another created field; CASE WHERE [PDT]>#12:15# THEN 'No' ELSE 'Yes' END with the Alias as PDA. This fails with the inability to find PDT? I'm also sure that the reference to time #12:15# is in error also, but I have to take things one at a time. You use # sign for time in Access.
First of all how do you reference a created field which has been created prior to the use of it in another created field?
Thanks
PS: Just thinking do I first need to create the fields in the Table? Plus how do you create a stored Procedure from another Stored Procedure? I have a lot to learn and little time, they want to comvert to my new ADP soon!
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Thursday, May 09, 2013 4:44 PM
Points: 2,869,
Visits: 370
|
|
Please, post the entire query.
From what I could understand from your post you could use a subquery or a derived table.
E.g.:
select C = derived_table_B.B + derived_table_B.A from ( select B = derived_table_A.A + 1 ,derived_table_A.A as A from ( select A = 2 + 3 ) derived_table_A ) derived_table_B
ML
--- Matija Lah, SQL Server MVP http://milambda.blogspot.com
|
|
|
|