[thelist] Simple string comparison -- plz help
Brian Delaney
brian.delaney at mccmh.net
Thu Jan 20 06:26:49 CST 2005
vAnswer returns either a Y or a N. WHenI compare Y to Y it always fails.
Must be because the SQL Y is really Y with 9 spaces after.
Brian Cummiskey wrote:
> Brian Delaney wrote:
>
>> In sql YorN is defined as a char, 10 allow NULL. There is either a N
>> or Y in the field.
>>
>
> This probably isn't your problem-- but a char should only be used in
> a controlled field of X-length. for example, 10 for a phone number, 9
> for a zipcode + 4, etc.
> otherwise, you really should use varchar. in this case, char(1) is
> all you need.
>
> If you want to make it more semantic, using a boolean field would be
> ideal. this is, afterall, a True/false response field.
>
>
> > vAnswer = rsStuff("YorN")
>
> well, if it always fails, What IS vAnswer?
>
> response.write vAnswer
>
> see what it is. if its a 'Y' and it fails, you have script problems.
> if its nothing, its going to fail- and that means you have a problem
> with your record set pulling a row properly.
>
>
*
*
*
This message, including any attachments, is intended solely for the use of the named recipient(s) and may contain confidential and/or priveleged information. Any unauthorized review, use, disclosure or distribution of this communication(s) is expressly prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy any and all copies of the original message.
More information about the thelist
mailing list