Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter Query With or Without leading Zeros

Status
Not open for further replies.

wesleylamb

Technical User
Mar 10, 2003
7
GB
Just wanted to know if there was an easier way of
selecting records in a parameter query with a ref no that has leading zeros. So the parameter can accept 000035356
or 35356.

What I have done is listed below

In Record Select Formula Editor I have this:

{Contact.ref_num} like "00000000" +right({?Ref No},1) or
{Contact.ref_num} like "0000000" +right({?Ref No},2) or
{Contact.ref_num} like "000000" +right({?Ref No},3) or
{Contact.ref_num} like "00000" +right({?Ref No},4) or
{Contact.ref_num} like "0000" +right({?Ref No},5) or
{Contact.ref_num} like "000" +right({?Ref No},6) or
{Contact.ref_num} like "00" +right({?Ref No},7) or
{Contact.ref_num} like "0" +right({?Ref No},8)or
{Contact.ref_num} like {?Ref No}

Thanks

cee cee
 
How about making your parameter a number type, then any entry of 000035356, will automatically become 35356, then convert the parameter for the selection formula using :

{Contact.ref_num} like Totext({?Ref No},"000000000")




Reebo
Scotland (Sunny with a Smile)
 
Thanks, I have just tried it, much easier, but would never have found it without your help.

Thanks

cc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top