Hello,
I am trying to use this if function in my report, but the imbedded variables are not showing the data they are linked to.
ie - it says {@.FX Currency} instead of EURO
I tried moving the quotes around, but it did not help. Any assistance is appreciated.
if {@.Hedge Des} = "Cash Flow"
then
"To offset changes in the spot price of {@.FX Currency}. This is accomplished by {@.Buy or Sell}ing {@.FX Currency} forward and excluding the forward points from the hedge effectiveness assessment."
else
"To offset changes in the spot price of {@.FX Currency}. This is accomplished by {@.Buy or Sell}ing {@.FXCurrency} forward, with the notional value of the hedge equal to the principal value of the loan."try this:
if {@.Hedge Des} = "Cash Flow"
then
"To offset changes in the spot price of "&{@.FX Currency}&". This is accomplished by "&{@.Buy or Sell}&"ing "&{@.FX Currency}&" forward and excluding the forward points from the hedge effectiveness assessment."
else
"To offset changes in the spot price of "&{@.FX Currency}&". This is accomplished by "&{@.Buy or Sell}&"ing "&{@.FXCurrency}&" forward, with the notional value of the hedge equal to the principal value of the loan."|||Worked like a charm! Thanks so much!
Showing posts with label function. Show all posts
Showing posts with label function. Show all posts
Friday, March 30, 2012
Wednesday, March 28, 2012
IF EXISTS for drop table.
what is the same statment like this "DROP TEMPORARY TABLE IF EXISTS
temp_item" for MS SQL? Does MS SQL have "IF EXISTS" function?
--
Message posted via http://www.sqlmonster.comif object_id('tempdb..#temp_item') is not null
drop table #temp_item
AMB
"Grant H via SQLMonster.com" wrote:
> what is the same statment like this "DROP TEMPORARY TABLE IF EXISTS
> temp_item" for MS SQL? Does MS SQL have "IF EXISTS" function?
> --
> Message posted via http://www.sqlmonster.com
>|||A sample for the employee table in the Northwind database:
if exists (select * from dbo.sysobjects where id =object_id(N'[dbo].[Employees]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Employees]
GO
--
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"Grant H via SQLMonster.com" <forum@.nospam.SQLMonster.com> schrieb im
Newsbeitrag news:1b883ba01f1b4a5481ba1fbd07890119@.SQLMonster.com...
> what is the same statment like this "DROP TEMPORARY TABLE IF EXISTS
> temp_item" for MS SQL? Does MS SQL have "IF EXISTS" function?
> --
> Message posted via http://www.sqlmonster.com|||Use Alejandro's example for temp tables, and Jens' example for permanent
tables.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Grant H via SQLMonster.com" <forum@.nospam.SQLMonster.com> wrote in message
news:1b883ba01f1b4a5481ba1fbd07890119@.SQLMonster.com...
> what is the same statment like this "DROP TEMPORARY TABLE IF EXISTS
> temp_item" for MS SQL? Does MS SQL have "IF EXISTS" function?
> --
> Message posted via http://www.sqlmonster.comsql
temp_item" for MS SQL? Does MS SQL have "IF EXISTS" function?
--
Message posted via http://www.sqlmonster.comif object_id('tempdb..#temp_item') is not null
drop table #temp_item
AMB
"Grant H via SQLMonster.com" wrote:
> what is the same statment like this "DROP TEMPORARY TABLE IF EXISTS
> temp_item" for MS SQL? Does MS SQL have "IF EXISTS" function?
> --
> Message posted via http://www.sqlmonster.com
>|||A sample for the employee table in the Northwind database:
if exists (select * from dbo.sysobjects where id =object_id(N'[dbo].[Employees]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Employees]
GO
--
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"Grant H via SQLMonster.com" <forum@.nospam.SQLMonster.com> schrieb im
Newsbeitrag news:1b883ba01f1b4a5481ba1fbd07890119@.SQLMonster.com...
> what is the same statment like this "DROP TEMPORARY TABLE IF EXISTS
> temp_item" for MS SQL? Does MS SQL have "IF EXISTS" function?
> --
> Message posted via http://www.sqlmonster.com|||Use Alejandro's example for temp tables, and Jens' example for permanent
tables.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Grant H via SQLMonster.com" <forum@.nospam.SQLMonster.com> wrote in message
news:1b883ba01f1b4a5481ba1fbd07890119@.SQLMonster.com...
> what is the same statment like this "DROP TEMPORARY TABLE IF EXISTS
> temp_item" for MS SQL? Does MS SQL have "IF EXISTS" function?
> --
> Message posted via http://www.sqlmonster.comsql
Wednesday, March 21, 2012
Identity whithout identity column
Hi!
Please help!
Is there a function in SQL Server that returns "ROWID" from any table
(without identity column) or how to get that number?
Regards, MarkoThere is no internal rowid in SQL Server (such violated the relational model). If you say what you
would need it for, we can suggest alternatives.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Marko Kopaè" <marko.kopac@.mais.si> wrote in message
news:%23Gp%23PYngDHA.2484@.TK2MSFTNGP09.phx.gbl...
> Hi!
> Please help!
> Is there a function in SQL Server that returns "ROWID" from any table
> (without identity column) or how to get that number?
> Regards, Marko
>
Please help!
Is there a function in SQL Server that returns "ROWID" from any table
(without identity column) or how to get that number?
Regards, MarkoThere is no internal rowid in SQL Server (such violated the relational model). If you say what you
would need it for, we can suggest alternatives.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Marko Kopaè" <marko.kopac@.mais.si> wrote in message
news:%23Gp%23PYngDHA.2484@.TK2MSFTNGP09.phx.gbl...
> Hi!
> Please help!
> Is there a function in SQL Server that returns "ROWID" from any table
> (without identity column) or how to get that number?
> Regards, Marko
>
Friday, March 9, 2012
Identity Function
I don't think this is possible as i've tried testing but just wanted to make sure.
Can you use a variable within the Identity Function? ie., Identity(int, @.start, 1)
If you can't is there another function to perform what I am trying to do?
Basically I would like to imitate an identity column to avoid mass updates and re-create tables that had an identity column.
Any help / advice would be greatly appreciated.
If I understood correctly, you want the identity value to start from a certain number and then increment by 1?You have some options for that:
Set the initial number of the identity column to the desired. E.g. start from 2000.
Identity Function
Hi,
I need to use the identity function as below except SQL server doesn't
appear to like it unless I specify the seed as a literal.
select identity(int, @.seed, 1)
into ...
Is there a possible work around?
Thanks,
BryanBB wrote:
> Hi,
> I need to use the identity function as below except SQL server doesn't
> appear to like it unless I specify the seed as a literal.
> select identity(int, @.seed, 1)
> into ...
> Is there a possible work around?
> Thanks,
> Bryan
You'll have to resort to dynamic SQL if you need a data-drive seed
value.
David Gugick
Imceda Software
www.imceda.com|||>> I need to use the identity function <<
Amazing, but I have been writing SQL for about two decades and I have
never had to use the identity function. Instead of telling how you
have decided to kludge the problem, could you tell us what that problem
is first? Please post DDL, so that people do not have to guess what
the keys, constraints, Declarative Referential Integrity, datatypes,
etc. in your schema are. Sample data is also a good idea, along with
clear specifications.|||As David suggested, you could use dynamic SQl, but to make it a bit easier,
You could just do the Select Into using Seed = 1, then run the following to
reset the seed t othe dynamic value you want...
Declare @.Seed TinyInt Set @.Seed = 1
Declare @.Sql VarChar(50)
Set @.Sql = 'Dbcc CheckIdent(NewTable, ReSeed, ' + Str(@.Seed,3) +')'
Exec (@.Sql)
"David Gugick" wrote:
> BB wrote:
> You'll have to resort to dynamic SQL if you need a data-drive seed
> value.
> --
> David Gugick
> Imceda Software
> www.imceda.com
>|||Thanks to everyone that responded.
"BB" <reply@.to.group.com> wrote in message
news:OUUcsJ7OFHA.4000@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I need to use the identity function as below except SQL server doesn't
> appear to like it unless I specify the seed as a literal.
> select identity(int, @.seed, 1)
> into ...
> Is there a possible work around?
> Thanks,
> Bryan
>
I need to use the identity function as below except SQL server doesn't
appear to like it unless I specify the seed as a literal.
select identity(int, @.seed, 1)
into ...
Is there a possible work around?
Thanks,
BryanBB wrote:
> Hi,
> I need to use the identity function as below except SQL server doesn't
> appear to like it unless I specify the seed as a literal.
> select identity(int, @.seed, 1)
> into ...
> Is there a possible work around?
> Thanks,
> Bryan
You'll have to resort to dynamic SQL if you need a data-drive seed
value.
David Gugick
Imceda Software
www.imceda.com|||>> I need to use the identity function <<
Amazing, but I have been writing SQL for about two decades and I have
never had to use the identity function. Instead of telling how you
have decided to kludge the problem, could you tell us what that problem
is first? Please post DDL, so that people do not have to guess what
the keys, constraints, Declarative Referential Integrity, datatypes,
etc. in your schema are. Sample data is also a good idea, along with
clear specifications.|||As David suggested, you could use dynamic SQl, but to make it a bit easier,
You could just do the Select Into using Seed = 1, then run the following to
reset the seed t othe dynamic value you want...
Declare @.Seed TinyInt Set @.Seed = 1
Declare @.Sql VarChar(50)
Set @.Sql = 'Dbcc CheckIdent(NewTable, ReSeed, ' + Str(@.Seed,3) +')'
Exec (@.Sql)
"David Gugick" wrote:
> BB wrote:
> You'll have to resort to dynamic SQL if you need a data-drive seed
> value.
> --
> David Gugick
> Imceda Software
> www.imceda.com
>|||Thanks to everyone that responded.
"BB" <reply@.to.group.com> wrote in message
news:OUUcsJ7OFHA.4000@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I need to use the identity function as below except SQL server doesn't
> appear to like it unless I specify the seed as a literal.
> select identity(int, @.seed, 1)
> into ...
> Is there a possible work around?
> Thanks,
> Bryan
>
Subscribe to:
Posts (Atom)