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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace character within a Query

Status
Not open for further replies.

Hargreavesk

Technical User
Jul 18, 2001
97
GB
Hi,

Can anyone help?

I have a query that brings me details of a cheque from a form I have just completed. The cheque amount is in this format £00.00 or £000,000.00. This is ok as it's a currency field. However, when the data is in the query I would like the data to look like this 00-00 or 000,000-00. I would like to be able to replace the decimal point with a hyphen but just for the query purposes and not the master table. If this makes sense, is there a way of doing it?

Regards

Kate
 
Well, is there an easy way or just a way? I think you are going to need to create a global function in a module that is called in your query. This function will need to read the field data, convert it to a string (CSTR), use the INSTR function to find the decimal place, and then using LEFT(), RIGHT, and concatenation, rebuild and return the string to the query.

That should get you started, if you still have problems, post back with your function so far and we can help more... Terry
**************************
* General Disclaimor - Please read *
**************************
Please make sure your post is in the CORRECT forum, has a descriptive title, gives as much detail to the problem as possible, and has examples of expected results. This will enable me and others to help you faster...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top