Showing posts with label automatically. Show all posts
Showing posts with label automatically. Show all posts

Thursday, March 29, 2012

Formula in SQL Enterprise manager

I have a table with 2 columns and I want to have a 3rd column that combines the 1st and 2nd column automatically and populates the 3rd column.

i know this can be done with the Formula option in the 3rd column but I dont know how to combine columns. One is of datatype int and the other is of datatype varchar.

Here are my column names etc.

name var
-------
step int
action varchar

thankscast the int as a varchar and concatenate them both together in an update statement

Friday, March 23, 2012

Formatting PDF (portrait vs. landscape)

When calling a report, in the URL i'm using rs:Format=PDF to render the
report directly to PDF. I'd like the PDF to automatically format the report
in landscape mode.
Is this possible?
Thanks,
BrianFound my answer in the archives.
Thanks.
"G" <brian.grant@.si-intl-kc.com> wrote in message
news:euQ%23WDrXEHA.2940@.TK2MSFTNGP09.phx.gbl...
> When calling a report, in the URL i'm using rs:Format=PDF to render the
> report directly to PDF. I'd like the PDF to automatically format the
report
> in landscape mode.
> Is this possible?
> Thanks,
> Brian
>

Wednesday, March 21, 2012

Formatting Numbers in an SQL Statement

Hi,
I have a table that has an ID field which is automatically incremented as each new record is added, so if I do a SELECT * FROM Table1 I get:
ID, Name
1, Billy
2, Bob
3, Tony
You get the idea. What I want to do is format the number differently when it's returned from an SQL statement so I get:
ID, Name
0001, Billy
0002, Bob
0003, Tony
So I need something like SELECT FORMATNUMBER(ID, 4), Name FROM Table1 - Does anything like this exist?
Little 'un.This type of functionality is probably better served in your code, rather than on Sql. Sql is rather slow at doing string functions.
SELECT
RIGHT( '0000' + cast( ID as varchar), 4 ) ID
FROM
table1
bill|||

Hi Bill,

Thanks for that, unfortunately it's not something I can do in my ASP code, so that should work a treat.

Little'un

sql