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

Default value using SQL

Status
Not open for further replies.

SkydivingSteve

Technical User
Feb 20, 2004
27
GB
When a new record is created, I want the value of a field to be the greatest value of the fields in that table (i.e. SELECT Max(order) FROM story; ). However when I enter the SQL into the default value, I get an error message when saving the table (The syntax of the subquery in this expression is incorrect.)

Any ideas?

Steve

"In the Jungle of the Senses
 
Design Table -> Data Type (Number) -> Default Value

I'm not using the Expression builder but entering directly into the Default value entry box.

Thanks for your help!
 
I've got a feeling you can't use selects in this context. I've a feeling you can only refer to other things in record constraints rather than field constraints.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top