I wrote code that uses the syscolumns and systables. and that seems to be working.
I will try your example but I think what you wrote is for vb/vba. I have used the schema in vba.
Thanks to both of you.
MikeD
If you have to use Status, you need to add if/then logic to the stored procedure based on the value of Status.
I think a trigger might be of use to enforce the correct entry.
MikeD
TJ,
You only want to run one or the other procedure depending on the value of Status. But we may be able to use the isnull function to supply either the Funding or the Cancel
Date.
You will have to test this, I dropped your original data I set up to test. If it works, it is really cool...
Thanks Nigelrivett for the input.
I saw another thread with some inline views and then did a little reading about paramerterized views.
I was trying to reduce the dependancies that shipped with a product.
Miked
I have a sp that I would like to convert into a view. Any Ideas on this?
Thanks
MikeD
TP_ProcLU (
@AllCovered char(1),
@PayorPlankey int
)
AS
If @AllCovered is null OR upper(@AllCovered)='T' OR @PayorPlankey is null
Begin
select p.IntProcCode,p.CPTCode,p.Descr,p.Prockey
from bil_procedures...
John,
The hypens are a typeo right???
--insert into jobs (site, model, shop, cc, position, job, Lastmodifiedlayout)
This would fail all the time but explain all the reads and no writes.
Otherwise I don't see anything that would cause what your talking about.
MikeD
Jerry,
Maybe it is my suffering from a cold but your not making much sense here. Lets do the first query.
You have
ID Agency_ID Agency name
Select ID, Agency_ID, [Agency name]
from Agency
Where ???? <==== What criteria do you want to use
where does Child of ID 1 mean
MikeD
Hi Kevin,
Using an Insert or Update trigger, you query the Fake Table called "Inserted" to get the info you wish.
Declare @Modifiedby varchar(50)
Select @Modifiedby =modifier from inserted
If @Modifiedby = "Ellen"
--Do something
Happy Hollidays
MikeD
Hi,
In your view that is customized for each road warrior you can hard code the 'ST',ST1...(if i'm understanding correctly)
Select
Col1,Col2,Col3...,
-- Example 1
'ST' as TERRCODE
-- Better yet
IsNull(TERRCODE,'ST')
--Still Better yet
IsNull(TERRCODE,(select top 1 TerrCode from MyLocalTable))...
Hi Lah,
Instead of a UDF, I would use a SP that returns the result set I wanted. Here is some code snips
Declare @sAllConsultants varchar(1000),@sConsultantName varchar(100)
--Set up a cursor for the Project. If you want more than 1 project, you must create/write to a temp table first then...
Hi TJ-
Here is the short answer:
select a.LoanNum,a.FundingDate,a.State,
dateadd(dd,b.Days,a.FundingDate) as PlannedDate
from tblloans A
left join tblStates b
on b.State=a.State and (a.FundingDate between b.StartDate and b.EndDate)
The Longer answer handles things like a time mixed in so that...
I have designed a process that has 4 stages that would run overnight on a server. There are about 4k new transactions every month added to about 256k current transactions.
Stage 1 -Check for any unyet processed transactions.
Sort/Update them into 3 different categories...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.