Examples of expressions in update queries

Examples of expressions in update queries

Use expressions such as the following in the Update To cell in the query design grid for the field you want to update.

Expression Result
"Salesperson" Changes value to Salesperson
#8/10/96# Changes date values to 10-Aug-96
Yes Changes No values in a Yes/No field to Yes
"PN"&[PartNumber] Adds PN to the beginning of each specified part number
[UnitPrice]*[Quantity] Calculates the product of UnitPrice and Quantity
[Freight]*1.5 Increases freight charges by 50 percent
DSum("[Quantity]*[UnitPrice]",
"Order Details","[ProductID]=" & [ProductID])
Where the Product IDs in the current table match the Product IDs in the Order Details table, updates sales totals based on the product of Quantity and UnitPrice
Right([ShipPostalCode],5) Truncates the leftmost characters in a field, leaving the five rightmost characters