April 9, 200322 yr I have two fields, serial_no and vehicle_id and I want to say if the serial_no is empty then the vehicle_id has to be 17 characters long, but if there is something in the serial_no then don't worry about the vehicle_id. I wrote: case(serial_no = " ", length(vehicle_id)=17) but it doesn't work because whether or not there is something in serial_no it still comes up saying I need something in the vehicle_id. How would I fix this?
April 9, 200322 yr Do you mean that if there is something in the Serial ID then you: a. still need a vehicle ID but length doesn't matter, or b. don't need a vehicle ID at all? You can do both of these by validating the vehicle_id field. For A: (IsEmpty(serial_no) and Length(vehicle_id) = 17) or (not IsEmpty(serial_no) and IsEmpty(vehicle_id)) For B: (IsEmpty(serial_no) and Length(vehicle_id) = 17) or (not IsEmpty(serial_no) and not IsEmpty(vehicle_id)) Then show an appropriate validation message like: "If the serial number is empty, then your vehicle id must be 17 characters long. If you have entered a serial number... etc etc"
Create an account or sign in to comment