Showing posts with label entered. Show all posts
Showing posts with label entered. Show all posts

Monday, March 19, 2012

Formatting database content

Hi
I have set up a SQL database to contain alist FAQ's for our company and
then plan to pull this info off using a web page.

So far I have entered the data but I am unable to control how it is
displayed inside SQL ie I cannot enter new blank lines I have tried
using lots of spaces but this does not work when I use the website to
display the info.

Is there a way of formatting and editing the data in the sql database
as I am unable to do this, if I try to edit the data in the database I
have to copy it to notepad delete what is in the database, edit the
text in notepad then paste it back in.

There must be a better way.

Please help

alamb200Sounds as if you need to convert your carraige return / line feed into the
HTML <BR> tag which will then give you the correct formatting on the screen.

If you want to do it in the database then use REPLACE( <col>, char(13) +
char(10), '<BR>' ) - check, it might be 10, 13 :)

Tony

--
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials

<alamb200@.hotmail.com> wrote in message
news:1147771818.200249.269650@.j55g2000cwa.googlegr oups.com...
> Hi
> I have set up a SQL database to contain alist FAQ's for our company and
> then plan to pull this info off using a web page.
> So far I have entered the data but I am unable to control how it is
> displayed inside SQL ie I cannot enter new blank lines I have tried
> using lots of spaces but this does not work when I use the website to
> display the info.
> Is there a way of formatting and editing the data in the sql database
> as I am unable to do this, if I try to edit the data in the database I
> have to copy it to notepad delete what is in the database, edit the
> text in notepad then paste it back in.
> There must be a better way.
> Please help
> alamb200|||I have just had a look at the parameter tag but as I am new to SQL I am
not sure how I would put this place.

For example if my prefix charecter was / and my suffix charecter was \
for the sake of argument nad i wanted a new line after the full stop
in the following text how would I enter the information.

If your printer is no longer printing your logo's or overlays it may
have lost the images that have been "Flashed" on to it, to reflash your
printer follow the following instructions. Log on to SB Client and go
into the Company Files section. Next goto Runtime then Maintenance and
System Manager Menu.

Also I seem to be unable to edit text already in the database and have
to delete it and reenter it every time, is there an easier way of doing
that.

Thanks

Anthony

Tony Rogerson wrote:
> Sounds as if you need to convert your carraige return / line feed into the
> HTML <BR> tag which will then give you the correct formatting on the screen.
> If you want to do it in the database then use REPLACE( <col>, char(13) +
> char(10), '<BR>' ) - check, it might be 10, 13 :)
> Tony
> --
> Tony Rogerson
> SQL Server MVP
> http://sqlserverfaq.com - free video tutorials
>
> <alamb200@.hotmail.com> wrote in message
> news:1147771818.200249.269650@.j55g2000cwa.googlegr oups.com...
> > Hi
> > I have set up a SQL database to contain alist FAQ's for our company and
> > then plan to pull this info off using a web page.
> > So far I have entered the data but I am unable to control how it is
> > displayed inside SQL ie I cannot enter new blank lines I have tried
> > using lots of spaces but this does not work when I use the website to
> > display the info.
> > Is there a way of formatting and editing the data in the sql database
> > as I am unable to do this, if I try to edit the data in the database I
> > have to copy it to notepad delete what is in the database, edit the
> > text in notepad then paste it back in.
> > There must be a better way.
> > Please help
> > alamb200|||On 16 May 2006 04:13:58 -0700, alamb200@.hotmail.com wrote:

>I have just had a look at the parameter tag but as I am new to SQL I am
>not sure how I would put this place.
>For example if my prefix charecter was / and my suffix charecter was \
>for the sake of argument nad i wanted a new line after the full stop
>in the following text how would I enter the information.

Hi Anthony,

wiith the right front-end, there's no need to use parameters. For
instance, copy and paste the following into Query Analyzer and execute;
you'll see that the output has exactly the lline breaks yoou asked for:

CREATE TABLE test (KeyColumn int NOT NULL PRIMARY KEY,
DataColumn varchar(1000) NOT NULL)
INSERT INTO test (KeyColumn, DataColumn)
VALUES (1, 'If your printer is no longer printing your logo''s or
overlays it may have lost the images that have been "Flashed" on to it,
to reflash your printer follow the following instructions.
Log on to SB Client and go into the Company Files section.
Next goto Runtime then Maintenance and System Manager Menu.')
go
SELECT * FROM test
go
DROP TABLE test
go

(Note: beware of extra line breaks inserted by Usenet software. In the
intended code, there are line breaks after the periods, but no other
line breaks in the VALUES clause.)

>Also I seem to be unable to edit text already in the database and have
>to delete it and reenter it every time, is there an easier way of doing
>that.

That, too, is a problem with your frontend.

May I ask you what tool you are using as your frontend?

--
Hugo Kornelis, SQL Server MVP|||Hi

I am using a web page as my front end using ASP to pull the info from
the SQL database so I am in the position of either having multiple
columns with small bits of info in my database so I can format them how
I want

The other option is to have some commands built into the text in the
database entry which will be read by the system and control the
formatting when it is read.

Is this possible?

When I am trying to edit the info in the database all I am doing is
right clicking on the table in Enterprise manager and display all
columns and working on it from there.

Is this the right way to do this?

Anthony

Hugo Kornelis wrote:
> On 16 May 2006 04:13:58 -0700, alamb200@.hotmail.com wrote:
> >I have just had a look at the parameter tag but as I am new to SQL I am
> >not sure how I would put this place.
> >For example if my prefix charecter was / and my suffix charecter was \
> >for the sake of argument nad i wanted a new line after the full stop
> >in the following text how would I enter the information.
> Hi Anthony,
> wiith the right front-end, there's no need to use parameters. For
> instance, copy and paste the following into Query Analyzer and execute;
> you'll see that the output has exactly the lline breaks yoou asked for:
> CREATE TABLE test (KeyColumn int NOT NULL PRIMARY KEY,
> DataColumn varchar(1000) NOT NULL)
> INSERT INTO test (KeyColumn, DataColumn)
> VALUES (1, 'If your printer is no longer printing your logo''s or
> overlays it may have lost the images that have been "Flashed" on to it,
> to reflash your printer follow the following instructions.
> Log on to SB Client and go into the Company Files section.
> Next goto Runtime then Maintenance and System Manager Menu.')
> go
> SELECT * FROM test
> go
> DROP TABLE test
> go
> (Note: beware of extra line breaks inserted by Usenet software. In the
> intended code, there are line breaks after the periods, but no other
> line breaks in the VALUES clause.)
> >Also I seem to be unable to edit text already in the database and have
> >to delete it and reenter it every time, is there an easier way of doing
> >that.
> That, too, is a problem with your frontend.
> May I ask you what tool you are using as your frontend?
> --
> Hugo Kornelis, SQL Server MVP|||On 17 May 2006 02:01:41 -0700, alamb200@.hotmail.com wrote:

>Hi
>I am using a web page as my front end using ASP to pull the info from
>the SQL database so I am in the position of either having multiple
>columns with small bits of info in my database so I can format them how
>I want
>The other option is to have some commands built into the text in the
>database entry which will be read by the system and control the
>formatting when it is read.
>Is this possible?

Hi Anthony,

I'm not an ASP guy, so I don't know. Are you saying that linebreaks in a
long character data column are not displayed properly by ASP? Have you
consiedered asking for alternatives in one of the ASP groups?

>When I am trying to edit the info in the database all I am doing is
>right clicking on the table in Enterprise manager and display all
>columns and working on it from there.
>Is this the right way to do this?

No, definitely not. Data entry through Enterprise Manager is broken in
far more ways than I care to remember. Some of these errors are listed
by Aaron Bertrand at http://www.aspfaq.com/show.asp?id=2455.

--
Hugo Kornelis, SQL Server MVP|||Hi

Go to http://212.50.191.220/techfaq and enter restart in the search box
in the bottom center this pops up a new page of info pulled from my SQL
database. As you can see it can be difficult to read so I would like to
add some line breaks and if possible some other formatting.

When I pull the info in it comes as one big lump of text so ASP cannot
format it what I beleive from one of my earlier replies is that I can
embed some commands into the text held in the entry to be pulled out of
the database that ASP can read and turn into html formatting when it is
displayed on the page.

Is this correct and if so how do I add them.

Anthony
Hugo Kornelis wrote:
> On 17 May 2006 02:01:41 -0700, alamb200@.hotmail.com wrote:
> >Hi
> >I am using a web page as my front end using ASP to pull the info from
> >the SQL database so I am in the position of either having multiple
> >columns with small bits of info in my database so I can format them how
> >I want
> >The other option is to have some commands built into the text in the
> >database entry which will be read by the system and control the
> >formatting when it is read.
> >Is this possible?
> Hi Anthony,
> I'm not an ASP guy, so I don't know. Are you saying that linebreaks in a
> long character data column are not displayed properly by ASP? Have you
> consiedered asking for alternatives in one of the ASP groups?
> >When I am trying to edit the info in the database all I am doing is
> >right clicking on the table in Enterprise manager and display all
> >columns and working on it from there.
> >Is this the right way to do this?
> No, definitely not. Data entry through Enterprise Manager is broken in
> far more ways than I care to remember. Some of these errors are listed
> by Aaron Bertrand at http://www.aspfaq.com/show.asp?id=2455.
> --
> Hugo Kornelis, SQL Server MVP|||On 18 May 2006 06:53:21 -0700, alamb200@.hotmail.com wrote:

>Hi
>Go to http://212.50.191.220/techfaq

"The page cannot be found"

>When I pull the info in it comes as one big lump of text so ASP cannot
>format it

I can only repeat my previous suggestion: if ASP has trouble retaining
embedded CR/LF combinations from a varchar column, then the best place
to seek help is an ASP group.

--
Hugo Kornelis, SQL Server MVP|||(alamb200@.hotmail.com) writes:
> When I pull the info in it comes as one big lump of text so ASP cannot
> format it what I beleive from one of my earlier replies is that I can
> embed some commands into the text held in the entry to be pulled out of
> the database that ASP can read and turn into html formatting when it is
> displayed on the page.

Neither do I know much ASP, but I would assume that if you get some
text from the database, and spit it out between regular <P> tags,
that any line breaks will be blissfully ignored, as that is how HTML
works.

You could use the <PRE> tag to maintain the line-breaks, but the text
would be presented in a monospaced font, so it may look a bit ugly.

You could run this:

SELECT replace(col, char(13) + char(10), <BR />)

to change line breaks to <BR /> tags. The <BR /> introduces a line break
in the text.

You could also store the text in HTML format.

But as Hugo says, asking in an ASP group is probably a good idea.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Formatting a textbox

I need to format a phone number parameter the user enters. Currently
when I print the parameter entered it displays like this ##########. I
want to format it to look like ###-###-####. Does anyone have any
ideas for making it look like that?E,
RS has a Custom Formatting built in where you can type in ###-###-####
for the Format.
But for phone Numbers the DB probably returns it as a string. You must
first convert it to a Number... a LONG in this case.
So go to report Properties go to Custom Code and put this in there:
Public Function convertToIntegerNow(tempVar2 As String)
convertToIntegerNow= CLng(tempVar2)
End Function
in the cell type in
=Code.convertToIntegerNow(Fields!Phone_Field_name.Value)
Then right click on the cell go to properties, change the format of the
cell to ###-###-####
Hope this helps
regards,
Stas K.

Friday, March 9, 2012

Format Y axis label as percentage

I have entered the code as P0 when formatting my Y axis to show 0% to 100%. This showed me percent values as 0% to 10,000%. Then after reading the forums I put the major gridline interval as 0.2 to get jumps of 20% but this just puts a lot of lines on the chart as 0,0.2,0.4 till 10,000%.

How can i fix this one ..

Thanks

Kiran

Kiranvukkadala wrote:

I have entered the code as P0 when formatting my Y axis to show 0% to 100%. This showed me percent values as 0% to 10,000%. Then after reading the forums I put the major gridline interval as 0.2 to get jumps of 20% but this just puts a lot of lines on the chart as 0,0.2,0.4 till 10,000%.

How can i fix this one ..

Thanks

Kiran

Have you set the minimum value on the scale to zero and the maximum value on the scale of the Y-axis to 100?

|||

Yes I have done so. I have tried removing that too

No luck

|||

Possibly the issue is your data. What is the maximum value of your data? Have you divided this into your field?

For example, if you try to display change as a fraction of a dollar:

Then one penny should be 1% of a dollar. To get 1%, you take 1/100 = .01 (1%)

If you didn't divide by 100, however, then one penny would be 1.00 (100%).

A dime would be 1000% and so on.

One dollar would be BEHOLD 10000% (There's that 10000 percent).

Most likely you have just put the field as raw data, not as a percentage and expected the format expression to do the division for you.

Try dividing by 100!!!!

|||

I have got a stacked chart and on the data fields I have put in 2 fields

% received and % latewhic combine together to give 100%.

The data points is actuallys et to give teh actual counts of these fields.

So would this count as raw data?

If I divide this percentage number by 100 it goes really small on the graph but the scale remains the same. How can I modify the scale.

I appreciate the time.

Kiran

|||

Oh I thought you were saying your data was going to 10,000%. Try changing your Y-scale to a minimum of zero and maximum of 1.

|||

Thanks for the replies.

I have tried that possibility too. This option is successfull in creating the axis from 1% to 100% but the data itself goes wrong. There is no split between the received and late numbers and its either 100% received or 100% late. I dont know why it does that. My assumption is that since maximum value of 1 is specified only the first 1% of the data is displayed.

Kiran

Friday, February 24, 2012

Format Currency Problem - HELP!

I need to display currency fields with a dollar sign, commas and no
decimal places. I entered
=FormatCurreny(fields!nameoffield.value,0,-1,-1)in the textbox
property's custom edit expressions box.
It drops the decimal places and adds the dollar sign just fine but,
I need the commas as well. What do I do?
I would apprectiate help here.
Thanks,
GailIf your Regional Settings in Control Panel is US, then go to the Format
property of the field in the Properties sheet and type in C0. (letter "C"
followed by a zero).
If your Regional Settings is not US, then go to the Language property of the
textbox, select English (United States) from the listbox, then in the Format
property type in C0.
Alternatively, you can just use an expression: =Format(FieldName, "$#,###").
HTH
Charles Kangai, MCT, MCDBA
"Gail Beedie" wrote:
> I need to display currency fields with a dollar sign, commas and no
> decimal places. I entered
> =FormatCurreny(fields!nameoffield.value,0,-1,-1)in the textbox
> property's custom edit expressions box.
> It drops the decimal places and adds the dollar sign just fine but,
> I need the commas as well. What do I do?
>
> I would apprectiate help here.
> Thanks,
> Gail
>|||YOU ARE MY HERO!!!!
GAIL
"Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message news:<B6BAD0E4-6010-4560-A59D-788C94A5640E@.microsoft.com>...
> If your Regional Settings in Control Panel is US, then go to the Format
> property of the field in the Properties sheet and type in C0. (letter "C"
> followed by a zero).
> If your Regional Settings is not US, then go to the Language property of the
> textbox, select English (United States) from the listbox, then in the Format
> property type in C0.
> Alternatively, you can just use an expression: =Format(FieldName, "$#,###").
> HTH
> Charles Kangai, MCT, MCDBA
>
> "Gail Beedie" wrote:
> > I need to display currency fields with a dollar sign, commas and no
> > decimal places. I entered
> > =FormatCurreny(fields!nameoffield.value,0,-1,-1)in the textbox
> > property's custom edit expressions box.
> >
> > It drops the decimal places and adds the dollar sign just fine but,
> > I need the commas as well. What do I do?
> >
> >
> > I would apprectiate help here.
> >
> > Thanks,
> > Gail
> >|||And mine as well. I had a different issue, but this clued me into what my
problem was. Thanks
"Gail Beedie" wrote:
> YOU ARE MY HERO!!!!
> GAIL
>
> "Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message news:<B6BAD0E4-6010-4560-A59D-788C94A5640E@.microsoft.com>...
> > If your Regional Settings in Control Panel is US, then go to the Format
> > property of the field in the Properties sheet and type in C0. (letter "C"
> > followed by a zero).
> >
> > If your Regional Settings is not US, then go to the Language property of the
> > textbox, select English (United States) from the listbox, then in the Format
> > property type in C0.
> >
> > Alternatively, you can just use an expression: =Format(FieldName, "$#,###").
> >
> > HTH
> >
> > Charles Kangai, MCT, MCDBA
> >
> >
> > "Gail Beedie" wrote:
> >
> > > I need to display currency fields with a dollar sign, commas and no
> > > decimal places. I entered
> > > =FormatCurreny(fields!nameoffield.value,0,-1,-1)in the textbox
> > > property's custom edit expressions box.
> > >
> > > It drops the decimal places and adds the dollar sign just fine but,
> > > I need the commas as well. What do I do?
> > >
> > >
> > > I would apprectiate help here.
> > >
> > > Thanks,
> > > Gail
> > >
>