Avatar of Stacie
Stacie
Flag for United States of America asked on

String format Money

I have the following querry that give me the cost of medication as 63.9300 I would like to have this fomat instead. $69.93

SELECT     Prescription.ClientID, Prescription.CostMedication, Prescription.ReApplyDate, Prescription.[Med Rcvd Date], Prescription.Dosages,
                      Prescription.Frequency, Prescription.Notes, Medication_1.Medicaiton_Name, Prescription.MedicationID
FROM         Prescription INNER JOIN
                      Medication_1 ON Prescription.MedicationID = Medication_1.Medication_ID
WHERE     (Prescription.ReApplyDate BETWEEN @Date1 AND @Date2)
ORDER BY Prescription.ClientID
SSRSSQL

Avatar of undefined
Last Comment
Hamed Nasr

8/22/2022 - Mon
kaufmed

Try:
SELECT     Prescription.ClientID, '$' + CONVERT(varchar(50), CONVERT(money, Prescription.CostMedication)), Prescription.ReApplyDate, Prescription.[Med Rcvd Date], Prescription.Dosages,
                      Prescription.Frequency, Prescription.Notes, Medication_1.Medicaiton_Name, Prescription.MedicationID
FROM         Prescription INNER JOIN
                      Medication_1 ON Prescription.MedicationID = Medication_1.Medication_ID
WHERE     (Prescription.ReApplyDate BETWEEN @Date1 AND @Date2)
ORDER BY Prescription.ClientID

Open in new window

ASKER CERTIFIED SOLUTION
Jason Yousef

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Hamed Nasr

"63.9300 I would like to have this fomat instead. $69.93"

Format (varCurr, "$#.00")
Hamed Nasr

Example select query:

SELECT a.f1, a.f2, Format([f3],"$#.00") AS Expr1
FROM a;
f1      f2      Expr1
1      2      $3.00
2      2      $4.00
2      3      $5.00
Your help has saved me hundreds of hours of internet surfing.
fblack61