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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set default value of a query field to a DAvg, possible?

Status
Not open for further replies.

SeadnaS

Programmer
May 30, 2011
214
I need to set the default value of a field in a query to a DAvg of a field in another query. I can't figure out how to do this. I basically need every value in the field to update to the same value everytime a new record is added.
 

I basically need every value in the field to update to the same value everytime a new record is added.

Are you running the UPDATE or INSERT statement?

If UPDATE statement like:

[tt]INSERT INTO tblMyTable(FieldABC, FieldXYZ)
VALUE([red]123[/red], 'ABCD')[/tt]

Is the (red) 123 a DAvg from another query?
Could you show us the SQL from 'another query'?

Have fun.

---- Andy
 

Since this would be a calculated value, it really should not be put into the query, especially since you seem to be making it the same value on every record. Just perform the calculation when the data is needed.


Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top