Showing posts with label numbers. Show all posts
Showing posts with label numbers. Show all posts

Monday, March 19, 2012

add to data

Hi All,
I have a database that has a field with phone numbers in.
I want to update the main part of the number to add the area code to
the main number.
I will do a selection on the postcode of the address and then I want to
add the correct area code to the beginning of the number.
Any help please.
SteveHi Steve,
First of all:
http://www.aspfaq.com/etiquette.asp?id=5006
Based on this its hard to give some suggestions but assuming some thing
here is some pseudocode
UPDATE CustomerTable
SET phoneNumber = CAST(RegionCode AS VARCHAR(10)) + CAST(phoneNumber
AS VARCHAR(100))
FROM CustomerTable C
INNER JOIN
RegionPhoeTable R
ON C.ZipCode = R.ZipCode
HTH, jens Suessmeyer.

add to data

Hi All,
I have a database that has a field with phone numbers in.
I want to update the main part of the number to add the area code to
the main number.
I will do a selection on the postcode of the address and then I want to
add the correct area code to the beginning of the number.
Any help please.
Steve
Hi Steve,
First of all:
http://www.aspfaq.com/etiquette.asp?id=5006
Based on this its hard to give some suggestions but assuming some thing
here is some pseudocode
UPDATE CustomerTable
SET phoneNumber = CAST(RegionCode AS VARCHAR(10)) + CAST(phoneNumber
AS VARCHAR(100))
FROM CustomerTable C
INNER JOIN
RegionPhoeTable R
ON C.ZipCode = R.ZipCode
HTH, jens Suessmeyer.

add to data

Hi All,
I have a database that has a field with phone numbers in.
I want to update the main part of the number to add the area code to
the main number.
I will do a selection on the postcode of the address and then I want to
add the correct area code to the beginning of the number.
Any help please.
SteveHi Steve,
First of all:
http://www.aspfaq.com/etiquette.asp?id=5006
Based on this its hard to give some suggestions but assuming some thing
here is some pseudocode
UPDATE CustomerTable
SET phoneNumber = CAST(RegionCode AS VARCHAR(10)) + CAST(phoneNumber
AS VARCHAR(100))
FROM CustomerTable C
INNER JOIN
RegionPhoeTable R
ON C.ZipCode = R.ZipCode
HTH, jens Suessmeyer.

Tuesday, March 6, 2012

add new column with runing numbers

Hello.
Whats the easiest way to add a column with a numeration to my table?
I want the users to have an easier life finding on which row they are
talking.
I preffer of course doing it in reporting service and not adding a
column in my dataset.
Thanks.
(its look like i have problems posting here so I hope it won't be
posted twice)You can simply add another column to your table control in a report and set
its Value property to expression containing RowNumber function. RowNumber
function in RS 2005 can take a string parameter - scope. That allows you to
reset the numeration in case you have some groupings.
--
Regards
Pawel Potasinski
U¿ytkownik "nicknack" <roezohar@.gmail.com> napisa³ w wiadomo?ci
news:1184825034.216931.48630@.x35g2000prf.googlegroups.com...
> Hello.
> Whats the easiest way to add a column with a numeration to my table?
> I want the users to have an easier life finding on which row they are
> talking.
> I preffer of course doing it in reporting service and not adding a
> column in my dataset.
> Thanks.
> (its look like i have problems posting here so I hope it won't be
> posted twice)
>|||Hi Pawel ,
Thanks for the replay.
I found the answer in one of my RS books :)
Never thought I'm going to open them.
Thank!
On 19 , 08:34, "Pawel Potasinski" <pawel.potasin...@.gmail.com>
wrote:
> You can simply add another column to your table control in a report and s=et
> its Value property to expression containing RowNumber function. RowNumber
> function in RS 2005 can take a string parameter - scope. That allows you =to
> reset the numeration in case you have some groupings.
> --
> Regards
> Pawel Potasinski
> U=BFytkownik "nicknack" <roezo...@.gmail.com> napisa=B3 w wiadomo=9Ccinews=:1184825034.216931.48630@.x35g2000prf.googlegroups.com...
> > Hello.
> > Whats the easiest way to add a column with a numeration to my table?
> > I want the users to have an easier life finding on which row they are
> > talking.
> > I preffer of course doing it in reporting service and not adding a
> > column in my dataset.
> > Thanks.
> > (its look like i have problems posting here so I hope it won't be
> > posted twice)|||I know what you mean. Lots of fine books, no time to read them...
--
Regards
Pawel Potasinski
Uzytkownik "nicknack" <roezohar@.gmail.com> napisal w wiadomosci
news:1185102275.499795.287050@.w3g2000hsg.googlegroups.com...
Hi Pawel ,
Thanks for the replay.
I found the answer in one of my RS books :)
Never thought I'm going to open them.
Thank!
On 19 , 08:34, "Pawel Potasinski" <pawel.potasin...@.gmail.com>
wrote:
> You can simply add another column to your table control in a report and
> set
> its Value property to expression containing RowNumber function. RowNumber
> function in RS 2005 can take a string parameter - scope. That allows you
> to
> reset the numeration in case you have some groupings.
> --
> Regards
> Pawel Potasinski
> U¿ytkownik "nicknack" <roezo...@.gmail.com> napisa³ w
> wiadomoocinews:1184825034.216931.48630@.x35g2000prf.googlegroups.com...
> > Hello.
> > Whats the easiest way to add a column with a numeration to my table?
> > I want the users to have an easier life finding on which row they are
> > talking.
> > I preffer of course doing it in reporting service and not adding a
> > column in my dataset.
> > Thanks.
> > (its look like i have problems posting here so I hope it won't be
> > posted twice)

Add n numbers of days to a date

Hi,

I have a textbox with date selected from calendar... Now i put in another textbox to enters number of day(30 or 120 or other), this number may vary...

so my qns is how to add the n numbers of days entered to the date selected? i stored date as smalldatetime

Help is appreciated

There is a function DATEADD you can use:

DATEADD(dd, yourFirstDate, 30)-- add 30 days to your first date.

you can use this in your insert or update statement. Let me know if you need more help.

|||

U r having the function Dateadd. U use the function

DATEADD(datepart,number,date)

DatepartAbbreviationsYearyy, yyyyquarterqq, qMonthmm, mdayofyeardy, yDaydd, dWeekwk, wwHourhhminutemi, nsecondss, smillisecondms

Thanks

Baba

Please remember to click "Mark as Answer" on this post if it helped you.

|||

Hi all,

Thank for replying.. Oh y under this section... Anyway i dun quite understand how to implement it in my codes...

Cos my Textbox for user to enter number of days to due date may vary... Like as i say in abv example

Step1: User select the firstdate from a calendar and display in TextBox1.Text (12/11/2007)

Step2: User enter the number of days to due date in TextBox2.Text (example, 30) <-- can be any number...no specific

Step3: On click a button it display the 12/12/2007 in a label maybe...

Step4: this label date is save to sql for future use...

So i need know how to implement it... as most example i googled has a specific days declare... As for step4 is easy so i only need to know step2 and 3

Any details example of how to do it?

Ur help is appreciated

Edit: I have try this codes... it works but how can i not specific the number of days... i wan the user to specific any number of days they want in TextBox2

Dim nowAsNew DateTime

now = tb_dop.Text

Dim lAsNew DateTime

l = now.AddDays(30)

TextBox1.Text = l

|||

OK

Thanks for the helps... I have figure it out as followed

Dim nowAsNew DateTime

now = tb_dop.Text

Dim iAsInteger

i = TextBox1.Text

Dim lAsNew DateTime

l = now.AddDays(i)

TextBox1.Text = l

Thursday, February 16, 2012

Add a number to string. (conversion problem)

Lets say I have a table named Projects with the data below.
Y07001
Y07002
Y07003
Y07010
Y07011
I want to pick up the last 3 numbers and add a one to it so.

Declare @.Countas varchar(3)SELECTTop 1 @.Count=Right(Project, 3)+1FROM ProjectsOrderby IDdesc

SELECT @.Count

This is what I am using. It picks up the last entry, add a one to it and gives me 12 in return. What i want is 012, not 12

What you want is probably this?

SELECT

RIGHT('000'+Convert(varchar,@.Count),3)