Replace function in a query

RexesOperator

Registered User.
Local time
Today, 15:27
Joined
Jul 15, 2006
Messages
604
Can the replace function be used in a query?

I have used this

=Replace(Format([SITELATSEC],"00.0"),".",",") in a report and it works fine.

I have the following expression in a query that is output to a report.

LAT: "Latitude: " & [SITELATDEG] & "º " & [SITELATMIN] & "' " & [SITELATSEC] & """ "

I need to be able to display [SITELATSEC] with a comma instead of a decimal point. I tried

LAT: "Latitude: " & [SITELATDEG] & "º " & [SITELATMIN] & "' " & =Replace(Format([SITELATSEC]00.0"),".",",") & """ "

and got an error message about too many commas.

On a more general note: Has anyone ever actually finished a database - ie got to the point where no changes needed to be made? 18 months after this started, and I'm still tryng to accomodate what my manager wants!
 
LAT: "Latitude: " & [SITELATDEG] & "º " & [SITELATMIN] & "' " &
=Replace(Format([SITELATSEC]00.0"),".",",") & """ "


In a query, you don't need the = sign and you have left out a comma and a double-quote.

Replace(Format([SITELATSEC],"00.0"),".",",")

^
 
Thank you EMP - that works perfectly! Fortunately our office updated to Access 2003 about a year ago (about 6 months after I started this project), and now Replace works in the query (at least what I implemented with EMP's eagle eyes).

Thanks for looking Wayne ..
 

Users who are viewing this thread

Back
Top Bottom