Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Mdavis123

    Is the Column there

    Angel, Are you from Tampa? I lived on AnnaMaria for a while and then moved south to Manasota Key. Back in Chicago now. Mike
  2. Mdavis123

    Is the Column there

    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
  3. Mdavis123

    Updating Dates Within A Date Range

    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
  4. Mdavis123

    Updating Dates Within A Date Range

    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...
  5. Mdavis123

    Stored Procedure to a View

    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
  6. Mdavis123

    Stored Procedure to a View

    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...
  7. Mdavis123

    SQL Server Join Problem

    This is news to me also. Thanks MikeD
  8. Mdavis123

    Need Help Analyzing 2 Tables

    Jack Don't use count(*). Use Count(Colx) in both sections of your query. See if it helps. MikeD
  9. Mdavis123

    INSERT INTO only appears to work

    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
  10. Mdavis123

    Reading from One Table

    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
  11. Mdavis123

    Don't know how to create simple trigger

    Hi Kevin, Using an Insert or Update trigger, you query the Fake Table called &quot;Inserted&quot; to get the info you wish. Declare @Modifiedby varchar(50) Select @Modifiedby =modifier from inserted If @Modifiedby = &quot;Ellen&quot; --Do something Happy Hollidays MikeD
  12. Mdavis123

    Default Field Values in a View

    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))...
  13. Mdavis123

    User Defined Function

    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...
  14. Mdavis123

    Updating Dates Within A Date Range

    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...
  15. Mdavis123

    Process Design Question

    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...
  16. Mdavis123

    SP_ExecuteSQL parameter help

    mrDenny, The word &quot;Set&quot; cause an identifer problem doing your exec(@CMD) This is why zhavic method is correct. Thanks to both. MikeD
  17. Mdavis123

    SP_ExecuteSQL parameter help

    Is there any downside to using sp_execute. I read in another post &quot;don't use it often&quot; I'm actually calling it 140 time is a sp. Thanks Mike
  18. Mdavis123

    SP_ExecuteSQL parameter help

    Thanks very much, I thought I could pass the FieldName variable in with the other vars. Thanks again, Mike
  19. Mdavis123

    Conditional Field in SELECT

    You need a Case selection/substtution. Select a, b, Case when x IS NOT NULL AND y IS NOT NULL Then 'Yes' Else 'No' End As C, D From mytable See BOL and CASE MikeD
  20. Mdavis123

    SP_ExecuteSQL parameter help

    Working on a large Report that has 76 queries of demographics on a quartly basis. I don't want to requery a quarter if it is completed so we only recalculate the current quarter and write it to a table that has these columns, Year, Quarter1,Quarter2,Quarter3,Quarter4,ID I need help with a...

Part and Inventory Search

Back
Top