Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can A Query Field Name Be Taken From A Record In Same Query

Status
Not open for further replies.

dominicdunmow

Technical User
Jul 28, 2004
125
CA
Hi there,

I have a form where users are asked to input the year into a year textbox (as well as other info), the text boxes are bound to a table.

I'd like to query the table, and in my query I'd like one of the field titles/names to be the year that the user entered in that particular recordset.

Is this possible?
 
Your user enters a year eg 2007 into a text field. Maybe this is called 'TerminationYear'. The you want to run a query where one of the fields is called '2007'. I can't just at the minute follow that. Why do you want the name of the field to be the same as the data content in one record?

 
Ah, okay.

The user is asked to input a contract start year - "2006", the contract start quarter "Q2", the projected revenue for this contract is then split between the quarters that make up the contact term.

i.e. 2006 Q3 = total contract revenue/(contract revenue/term * 4)

This split is done within a form and the values are retruned to the tale.

The problem I now have is that I need a revenue total per year. The complication exists where the contract starts in quarter 4 of a year - then the total for that year is not a straight forward calculation as such, and labelling this field is more difficult as if the contract starts in 2005 the year 1 revenue total filed has to be titled 2005, if it starts in 2006 the field must named 2006 etc.

If I can name the field after the year value entered this would make things easier.

Hopefully you get the jist of this!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top