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

Right Justify Query field 2

Status
Not open for further replies.

molly

Technical User
Joined
Jul 17, 2000
Messages
219
Location
US
Drawing a blank. Can't find an answer. I have 2 fields in a query. When i execute the Qry, the answers are left justified. I want them right justified.

the 701A field is text and 701B is a number based field.

701A JAR Size: IIf([PackTypeID]=701,[Size],"")

701B JAR Price: IIf([PackTypeID]=701,Format(Round(nz([Price]),2),"Fixed"),"")

Can you help? Thanks Molly
 
Too easy mate,

Acess thinks you're deeling with TEXT so it left justifies. Force it to numbers thus:

701A JAR Size: [red]CInt([/red]IIf([PackTypeID]=701,[Size],[red]0[/red]))

701B JAR Price: [red]CInt([/red]IIf([PackTypeID]=701,Format(Round(nz([Price]),2),"Fixed"),[red]0[/red]))


 
Do the formatting with the tool used to display the data (Form/Report/...), not in SQL.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you both. When i posted, i was doing the qry one way until i got a message about not enough resources.
so i made a different Qry and, as PHV noted, i did right format the Price field in the Report.

But i will keep this idea around for future work.
thanks alot. Molly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top