Can someone tell me how i can create an iif function to do the following?
I need to look a field that has an amount in it. if it is 90K or less make i
t
1 if its 180 to 90001 make it 2 etc...
So for every 90K in that amount add 1..
I tried to do a VB code to create a ceiling funciton but Access keeps giving
me an error saying that my function is undefinded? Had a friend run my code
and it worked for him. I did update to the most current service pack and it
still errors out...
Can anyone tell me how I can make either the function work or how to do an
iif function to make it work?
Thank you so much for any help you can give me> Can someone tell me how i can create an iif function to do the following?
> I need to look a field that has an amount in it. if it is 90K or less make
> it
> 1 if its 180 to 90001 make it 2 etc...
SELECT val = CASE WHEN column < 90000 THEN 1
WHEN column < 180000 THEN 2
WHEN column < 270000 THEN 3
ELSE 4 END
FROM table
This is covered here (along with some other things that will help an Access
person moving to SQL Server):
http://www.aspfaq.com/2214|||Please repost this to a Access NG.
HTH
Jerry
"magikgb via webservertalk.com" <u15188@.uwe> wrote in message
news:566081edf8196@.uwe...
> Can someone tell me how i can create an iif function to do the following?
> I need to look a field that has an amount in it. if it is 90K or less make
> it
> 1 if its 180 to 90001 make it 2 etc...
> So for every 90K in that amount add 1..
> I tried to do a VB code to create a ceiling funciton but Access keeps
> giving
> me an error saying that my function is undefinded? Had a friend run my
> code
> and it worked for him. I did update to the most current service pack and
> it
> still errors out...
> Can anyone tell me how I can make either the function work or how to do an
> iif function to make it work?
> Thank you so much for any help you can give me|||ummmm... divide by 90k and add 1? Assuming integers, then:
select 89000 / 90000 + 1 -- = 1
select 90001 / 90000 + 1 -- = 2
select 810001 / 90000 + 1 -- = 10
Payson
magikgb via webservertalk.com wrote:
> Can someone tell me how i can create an iif function to do the following?
> I need to look a field that has an amount in it. if it is 90K or less make
it
> 1 if its 180 to 90001 make it 2 etc...
> So for every 90K in that amount add 1..
> I tried to do a VB code to create a ceiling funciton but Access keeps givi
ng
> me an error saying that my function is undefinded? Had a friend run my cod
e
> and it worked for him. I did update to the most current service pack and i
t
> still errors out...
> Can anyone tell me how I can make either the function work or how to do an
> iif function to make it work?
> Thank you so much for any help you can give me|||Thank you Aaron... I am new to VB is this VB code or just straight SQL?
Aaron Bertrand [SQL Server MVP] wrote:
>SELECT val = CASE WHEN column < 90000 THEN 1
> WHEN column < 180000 THEN 2
> WHEN column < 270000 THEN 3
> ELSE 4 END
>FROM table
>This is covered here (along with some other things that will help an Access
>person moving to SQL Server):
>http://www.aspfaq.com/2214|||This is T-SQL. You are posting to a SQL Server newsgroup. If you are
trying to write VB code or Access SQL, please post to a more appropriate
newsgroup. Then people won't waste their time providing you with useless
solutions...
"magikgb via webservertalk.com" <u15188@.uwe> wrote in message
news:5660b960e4dd5@.uwe...
> Thank you Aaron... I am new to VB is this VB code or just straight SQL?
> Aaron Bertrand [SQL Server MVP] wrote:|||Aaron.. Sorry new to this too...
Aaron Bertrand [SQL Server MVP] wrote:
>This is T-SQL. You are posting to a SQL Server newsgroup. If you are
>trying to write VB code or Access SQL, please post to a more appropriate
>newsgroup. Then people won't waste their time providing you with useless
>solutions...
>
>[quoted text clipped - 16 lines]
Showing posts with label amount. Show all posts
Showing posts with label amount. Show all posts
Tuesday, March 20, 2012
Thursday, February 16, 2012
About memory amount that SQL Server uses
Is there any function or something like that that returs the amount of MS
SQL Server 2000 memory usage?
Thanks.Take a look into dbcc perfmon command.
Thanks
Hari
SQL Server MVP
"Grcan YCEL" <gurcan@.workmail.com> wrote in message
news:eOwBUw2xGHA.3500@.TK2MSFTNGP02.phx.gbl...
> Is there any function or something like that that returs the amount of MS
> SQL Server 2000 memory usage?
> Thanks.
>|||DBCC MEMORYSTATUS returns the buffer memory allocations (in units of 8kb
pages). This reports the main memory allocations used for data caching &
execution plan caching but there are other memory allocations which you can
collect from the Perfmon's Process(sqlservr) performance counter.. If you
want to translate the buffer counts to Mb, simply multiply them by 8192.0 &
divide by 1048576.0
Regards,
Greg Linwood
SQL Server MVP
"Grcan YCEL" <gurcan@.workmail.com> wrote in message
news:eOwBUw2xGHA.3500@.TK2MSFTNGP02.phx.gbl...
> Is there any function or something like that that returs the amount of MS
> SQL Server 2000 memory usage?
> Thanks.
>
SQL Server 2000 memory usage?
Thanks.Take a look into dbcc perfmon command.
Thanks
Hari
SQL Server MVP
"Grcan YCEL" <gurcan@.workmail.com> wrote in message
news:eOwBUw2xGHA.3500@.TK2MSFTNGP02.phx.gbl...
> Is there any function or something like that that returs the amount of MS
> SQL Server 2000 memory usage?
> Thanks.
>|||DBCC MEMORYSTATUS returns the buffer memory allocations (in units of 8kb
pages). This reports the main memory allocations used for data caching &
execution plan caching but there are other memory allocations which you can
collect from the Perfmon's Process(sqlservr) performance counter.. If you
want to translate the buffer counts to Mb, simply multiply them by 8192.0 &
divide by 1048576.0
Regards,
Greg Linwood
SQL Server MVP
"Grcan YCEL" <gurcan@.workmail.com> wrote in message
news:eOwBUw2xGHA.3500@.TK2MSFTNGP02.phx.gbl...
> Is there any function or something like that that returs the amount of MS
> SQL Server 2000 memory usage?
> Thanks.
>
About memory amount that SQL Server uses
Is there any function or something like that that returs the amount of MS
SQL Server 2000 memory usage?
Thanks.Take a look into dbcc perfmon command.
Thanks
Hari
SQL Server MVP
"Gürcan YÜCEL" <gurcan@.workmail.com> wrote in message
news:eOwBUw2xGHA.3500@.TK2MSFTNGP02.phx.gbl...
> Is there any function or something like that that returs the amount of MS
> SQL Server 2000 memory usage?
> Thanks.
>|||DBCC MEMORYSTATUS returns the buffer memory allocations (in units of 8kb
pages). This reports the main memory allocations used for data caching &
execution plan caching but there are other memory allocations which you can
collect from the Perfmon's Process(sqlservr) performance counter.. If you
want to translate the buffer counts to Mb, simply multiply them by 8192.0 &
divide by 1048576.0
Regards,
Greg Linwood
SQL Server MVP
"Gürcan YÜCEL" <gurcan@.workmail.com> wrote in message
news:eOwBUw2xGHA.3500@.TK2MSFTNGP02.phx.gbl...
> Is there any function or something like that that returs the amount of MS
> SQL Server 2000 memory usage?
> Thanks.
>
SQL Server 2000 memory usage?
Thanks.Take a look into dbcc perfmon command.
Thanks
Hari
SQL Server MVP
"Gürcan YÜCEL" <gurcan@.workmail.com> wrote in message
news:eOwBUw2xGHA.3500@.TK2MSFTNGP02.phx.gbl...
> Is there any function or something like that that returs the amount of MS
> SQL Server 2000 memory usage?
> Thanks.
>|||DBCC MEMORYSTATUS returns the buffer memory allocations (in units of 8kb
pages). This reports the main memory allocations used for data caching &
execution plan caching but there are other memory allocations which you can
collect from the Perfmon's Process(sqlservr) performance counter.. If you
want to translate the buffer counts to Mb, simply multiply them by 8192.0 &
divide by 1048576.0
Regards,
Greg Linwood
SQL Server MVP
"Gürcan YÜCEL" <gurcan@.workmail.com> wrote in message
news:eOwBUw2xGHA.3500@.TK2MSFTNGP02.phx.gbl...
> Is there any function or something like that that returs the amount of MS
> SQL Server 2000 memory usage?
> Thanks.
>
Thursday, February 9, 2012
About automatic process at midnight
Hi
I have a table1 which hold a field (amount) with 1000 rows
The amount in the 1000 rows is consumed by clients during the day
The next day the amounts have to return to their original values (at this
time I’m doing that by hand)
Now I’m going to save the original values in another table
My question is: Can the SQL server copy the original values from table1 to
table2 at midnight or at a time I schedule?
Thks again.Yes. Create a SQL Agent job. Make sure the SQLSERVERAGENT service is set t
o
Automatic.
"Kenny M." wrote:
> Hi
> I have a table1 which hold a field (amount) with 1000 rows
> The amount in the 1000 rows is consumed by clients during the day
> The next day the amounts have to return to their original values (at this
> time I’m doing that by hand)
> Now I’m going to save the original values in another table
> My question is: Can the SQL server copy the original values from table1 to
> table2 at midnight or at a time I schedule?
> Thks again.
>|||Insert them into a new table
1.INSERT INTO NewTableName
Select * From OldTableName
2.Update the Working table (at night after the work) with a update statement
referencing the ID column of the table
BEGIN Transaction
DELETE FROM Oldtable where ID IN (Select IDCOLUMN From NewTable)
INSERT INTO Oldtable SELECT * from NewTable
IF @.@.ERROR = 0
COMMIT
ELSE
ROLLBACK
Is it that what you ment ?
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Kenny M." <KennyM@.discussions.microsoft.com> schrieb im Newsbeitrag
news:D19D255D-E863-4E71-8E53-2145187103A7@.microsoft.com...
> Hi
> I have a table1 which hold a field (amount) with 1000 rows
> The amount in the 1000 rows is consumed by clients during the day
> The next day the amounts have to return to their original values (at this
> time I'm doing that by hand)
> Now I'm going to save the original values in another table
> My question is: Can the SQL server copy the original values from table1 to
> table2 at midnight or at a time I schedule?
> Thks again.
>
I have a table1 which hold a field (amount) with 1000 rows
The amount in the 1000 rows is consumed by clients during the day
The next day the amounts have to return to their original values (at this
time I’m doing that by hand)
Now I’m going to save the original values in another table
My question is: Can the SQL server copy the original values from table1 to
table2 at midnight or at a time I schedule?
Thks again.Yes. Create a SQL Agent job. Make sure the SQLSERVERAGENT service is set t
o
Automatic.
"Kenny M." wrote:
> Hi
> I have a table1 which hold a field (amount) with 1000 rows
> The amount in the 1000 rows is consumed by clients during the day
> The next day the amounts have to return to their original values (at this
> time I’m doing that by hand)
> Now I’m going to save the original values in another table
> My question is: Can the SQL server copy the original values from table1 to
> table2 at midnight or at a time I schedule?
> Thks again.
>|||Insert them into a new table
1.INSERT INTO NewTableName
Select * From OldTableName
2.Update the Working table (at night after the work) with a update statement
referencing the ID column of the table
BEGIN Transaction
DELETE FROM Oldtable where ID IN (Select IDCOLUMN From NewTable)
INSERT INTO Oldtable SELECT * from NewTable
IF @.@.ERROR = 0
COMMIT
ELSE
ROLLBACK
Is it that what you ment ?
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Kenny M." <KennyM@.discussions.microsoft.com> schrieb im Newsbeitrag
news:D19D255D-E863-4E71-8E53-2145187103A7@.microsoft.com...
> Hi
> I have a table1 which hold a field (amount) with 1000 rows
> The amount in the 1000 rows is consumed by clients during the day
> The next day the amounts have to return to their original values (at this
> time I'm doing that by hand)
> Now I'm going to save the original values in another table
> My question is: Can the SQL server copy the original values from table1 to
> table2 at midnight or at a time I schedule?
> Thks again.
>
Subscribe to:
Posts (Atom)