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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Chuck712

  1. Chuck712

    Update columns automatically in reports

    Sorry other attachment for the client didn't attach http://files.engineering.com/getfile.aspx?folder=a8f74b07-bd88-4eb4-a906-47580ac1f1ac&file=Test_Trend_May_2016_NEW.xls
  2. Chuck712

    Update columns automatically in reports

    I'm not sure this can be done, but I have a report that in manually updated in Excel for distribution. The client would like to have it automatically sent monthly using SSRS. The reports shows trending of membership from month to month based on data from a table that gets populated with a SQL...
  3. Chuck712

    Dynamic pivot returns PIVOT operator error

    I have found the issue. WHERE DATEPART(yyyy,' + convert(nvarchar,@finish_date,101) + ') = h10_year was throwing everything off..
  4. Chuck712

    Dynamic pivot returns PIVOT operator error

    I am trying to construct a dynamic pivot query for a report that uses a company period counts table for monthly membership by chapter. What the table has a column for the year and a separate column for the month as there is a stored procedure that fires monthly to populate the values for the...
  5. Chuck712

    Using Replace to add a single quote SQL

    Thanks. I think I found the solution. I was trying not to send a huge statment that I would have to de identify. But I got the string to work. The field we were evaluating needed the quotes. I appreciate the help.
  6. Chuck712

    Using Replace to add a single quote SQL

    I have a field in a survey results table that was populated with jscript code for the recommended action based on a set of answers. The field name is g.Risk_Validation. Data inside looks like this : {n1} == 7C2A4E1F-D2AB-4263-A1D5-78B93C4C0E90 || {n1} == B5F6DDC7-FCF2-4209-8F1C-D974B2158AAE...
  7. Chuck712

    MIN Date function in Having clause returns error

    Thanks George, This makes perfect sense now that I see it. And it was exactly what I was looking for. I searched BOL and many SQL web sites, but nothing like this came to light.
  8. Chuck712

    MIN Date function in Having clause returns error

    It ran and without taking the rest of the night to verify, it looks correct. I had to change SELECT h48_ind_cst_key since it gave an ambigous error, but this appears to be what I was looking for. I was hoping to reuse this when I have to pull the same results for the "third" month of ownership.
  9. Chuck712

    MIN Date function in Having clause returns error

    Thanks. I have to remote into another network to get to the machine, so it takes some time. Standby
  10. Chuck712

    MIN Date function in Having clause returns error

    Here is the query that cut and pasted with the correct prefix and table name. ;With EndDates As ( Select h48_ind_cst_key, DateAdd(Month, 1, DateAdd(Day, DateDiff(Day,0, MIN(h48_activity_date)), 0)) As EndDate From client_activity_log Group By h48_ind_cst_key ) SELECT...
  11. Chuck712

    MIN Date function in Having clause returns error

    Thanks. My database did not recognize StartDates or EndDates. I did copy and paste the query directly into the query window, however I changed the field names and table names. In the query I posted they were changed to protect the innocent. I am going to make sure that I haven't messed something up.
  12. Chuck712

    MIN Date function in Having clause returns error

    Not only headed down the wrong path, but going to a different zip code. Where you have "; With EndDates As" in the first line in the above code, I assume that there was more there. Like a with StartDates logic? Yes, I would appreciate an explanation, as I struggled with this for a couple of...
  13. Chuck712

    MIN Date function in Having clause returns error

    I am tried several approaches to this and searched for an answer but haven't found anything so here goes. I have been tasked with getting the result from an activity tracking table for the first 30 days of activity. Problem is each user has a different activity start date. The results are...
  14. Chuck712

    @@Rowcount trying to create a header row in text file

    Never mind. I found that this is working, just the union is selecting it out of order so I am getting this kind of results : 0000440039231436629XiYcgrTy TgnggTgXis 0000440063454087231YgrX TipscoYc 0000450004486647461YichggT YontgoYgry...
  15. Chuck712

    @@Rowcount trying to create a header row in text file

    I have been searching but can't seem to locate an answer for this. I have a file I need to create that has a header row with the count of the number of rows that will be following for checking. When the initial test sp was built there were only the TOP 10 records selected and when the SQL was...

Part and Inventory Search

Back
Top