View Full Version : Help!!! if field is like something


hullstorage
07-16-2008, 06:46 AM
this is what a am tring to do:

i have a report that show me various postcodes
like this

postcode field surcharge field
ab43 1ul 6.00
ab1 1un 6.00
hu1 1un 0.00
nr11 1ez 0.00
ky11 1en 12.00
ky1 1up 12.00

so what i am trying to do is create a surcharge field and if
the postcode is something begining with AB then surcharge field = 6.00
and if KY then surcharge is 12.00

any help please

midmented
07-16-2008, 06:50 AM
If these are values already in a field then why are they not displayed already? I don't understand.....

hullstorage
07-16-2008, 06:53 AM
sorry there isnt
basically if i open a report and the postcode field is like AB** then the surcharge field
would be 6.00
i think it a bit like
if postcode is like ab** then surcharge = 6.00
and if postcode is like KY** then me.surcharge=12.00

MSAccessRookie
07-16-2008, 06:54 AM
Would something like this work?

IIf(postcode LIKE "ab*", 6.00, IIf(postcode LIKE "ky*", 12.00, 0.00))

hullstorage
07-16-2008, 08:20 AM
tried nothing happening just getting a lot of error message
unless i am doing something wrong

Brianwarnock
07-16-2008, 08:23 AM
You should be doing this in the query on which the report is based.

Brian

Brianwarnock
07-16-2008, 08:33 AM
tried nothing happening just getting a lot of error message
unless i am doing something wrong

What are your error messages, we need help to help.

Brian

Rich
07-16-2008, 10:57 PM
These values should be stored along with the rest of the record details, they'd probably be taken from a lookup table at the time of the record creation