Robbydobbs Posted April 9, 2003 Share Posted April 9, 2003 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? Link to comment Share on other sites More sharing options...
RussBaker Posted April 9, 2003 Share Posted April 9, 2003 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" Link to comment Share on other sites More sharing options...
Robbydobbs Posted April 9, 2003 Author Share Posted April 9, 2003 Thanks so much Russ that's exactly what I needed. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7852 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now