how to add data to specific records

basilyos

Registered User.
Local time
Today, 10:58
Joined
Jan 13, 2014
Messages
256
hello guys
i have a table
ID - File Type - Source - Delivery - Return
1 - X - LB - ROY - LB via Roy
2 - Y - USA - Smith - USA via Smith
3 - Z - LB - -

my question is how can i make the last column (Return) to fill like the data above

what i mean if (Delivery) not null So the return will be filled like the above if the (Delivery) is null the return will be null too

i don't know if i explained my problem


the user will fill only the columns (File Type - Source - Delivery)
the column (Return) will be filled automatically if (Delivery) not null
 
Looks like return is a calculated value so should not be stored in your table.

Your query would look something like

Code:
SELECT *, iif(IsNull(Source),"",[File Type] & " via ") & Source AS Return FROM myTable
 
Generally you don't store calculated date, instead you calculate it. This seems to be calculated data.

What you would do is create a query to generate the 'Return' value. It would look like this:

Return: [Source] & " via " & [Delivery]

Actually, you would need a conditional statement on there to make it show blank if [Delivery] is null. Use these functions to add that part:

IIf - http://www.techonthenet.com/access/functions/advanced/iif.php
IsNull - http://www.techonthenet.com/access/functions/advanced/isnull.php
 

Users who are viewing this thread

Back
Top Bottom