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!

Formatting of fields in report 1

Status
Not open for further replies.

groleau

Programmer
Apr 12, 2006
110
US
Had date fields that showed as long date and time (midnight) to the second. Set format in properties to mm-dd-yyyy (hey, it works in Access and Excel!)

But what I get (using today for example) is
Code:
00-13-2007

Then on a money field, I had four decimal places. I managed to get rid of the last two useless zeroes, but it also added the dollar sign. Since the charges range from one digit to five, I'd like to either remove the dollar sign or move them all to the left, ouside of the column of digits. (Hard to look at a long column of digits with
dollar signs embedded in it.) If I paste in a format string that works in Excel or Access, will it work here?

--
Wes Groleau
 
If I paste in a format string that works in Excel or Access, will it work here?"

I should have just tried it--the answer is NO.

--
Wes Groleau
 
set format properties to MM-dd-yyyy

In .NET syntax m = minute, M = month

not sure exactly what you mean by your 2nd question - can you clarify? an example maybe?

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks! for the MM vs. mm pointer. I wonder why they swapped places in what they've offered Excel and Access users for years. (Congratulations, Microsoft on doing a typical Windows-style screwup in a product that is for the most part unlike the crap you've been known for in the past.)

As for the second question, Both Access and Excel have a format selector that also offers a "custom" box where you can type in the format you want. The sytnx is not hard, unless you want things typically only accountants care about. Then it gets very complicated. I got an Excel field the way I wanted in SSRS and pasted in the format codes. The result was that the report displayed the Excel/Access codes instead of the data.

--
Wes Groleau
 
Some format fields work the same but SSRS will use formats associated with databases rather than spreadsheets so not all will work

What is the actual format you want to apply?

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
I'm sorry, I misunderstood your question about my question.

In Excel, we would have used "Accounting" format without a dollar sign.
Code:
  1,234.56
(    78.90)
    987.65
(     1.23)
as opposed to the SSRS "money" format of
Code:
$1,234.56
  ($78.90)
  $987.65
   ($1.23)
in which the '$' and '(' in-line with digits interferes with readability

--
Wes Groleau
 
I think we lost a couple of exchanges in this thread. If I recall, you wanted negative numbers to display in parentheses.

Try an expression:

Code:
=FormatNumber(yourNumber, NumDigitsAfterDecimal, IncludeLeadingDigit, UseParensForNegativeNumbers, GroupDigit)

only yourNumber is required.

NumDigitsAfterDecimal = just what you'd expect :)

The other three parameters each take one of three values:
-1 will use regional settings options
0 will not use options
-2 will use default setting.

Setting the optional parameters to 2,0,-1,-1 should get you closer to what you want.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top