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 Rofeu

  1. Rofeu

    How to get a parameter entry to identify a table.column

    Take care that the dynamic SQL is highly vulnerable to sql injection attacks. Also, you run it with the EXEC or EXECUTE statement, e.g. EXEC 'dynamic ' + @SQL + ' string' Cheers, Rofeu
  2. Rofeu

    Active worksheet help

    just remove the outer loop and replace the ws variable with the codename of the worksheet for which you want the charts printed. Cheers, Rofeu
  3. Rofeu

    ISODD() is odd

    If you want to use an array-formula and be flexible wrt the base you can use (MOD(COLUMN(<ref>)+<offset>,<ColDif>)=0) instead of ROW(data)=ODD(ROW(data)), where <ColDif> is the number of columns per which you want to check and <offset> the column you want with respect to the base, where <offset>...
  4. Rofeu

    2 consecutive SendKeys commands

    What software are you running? Why are you using SendKeys?
  5. Rofeu

    How come the Macro is not working?

    true, Loomah. Feipezi, can you try to declare the variable as a pivotfield? add this at the top of the code: Dim pf As PivotField Shouldn't really make a difference, but worth a shot. Also, you speak of 'unchecking', this makes me wonder if you're really trying to hide PivotItems instead of...
  6. Rofeu

    Work out last race winner

    please ignore the last comment in between brackets. This is obviously flawed. I was working under the impression that you needed to check if a dog had won a race in the last 3 or 6 races, in which case the min is what you need. I understand now that the dog has to have won ALL of the previous 3...
  7. Rofeu

    Work out last race winner

    Hi, you're right about the order by clause, but not the max. You want to know if there is an instance where the dog has come in at place 1, right? The COUNT seems redundant, as if the dog came in at place 1 in a race in less than 3 respectively 6 races, it would come in at place 1 in a race in...
  8. Rofeu

    Work out last race winner

    Sorry, forgot to amend some references: select R.* , case (select min(R1.Finish) from (select top 1 R2.Finish from RaceResults R2 where R2.RaceId < R.RaceId and R2.Dog = R.Dog)R1) when 1 then 'YES'...
  9. Rofeu

    Work out last race winner

    hmmm, missed that part. How about this: select R.* , case (select min(R1.Finish) from (select top 1 R2.Finish from RaceResults R2 where R1.RaceId < R.RaceId and R1.Dog = R.Dog)R1) when 1 then 'YES'...
  10. Rofeu

    ISODD() is odd

    In office 2003 the ISODD formula is non-standard and is not suited for use in an array-formula. In 2007 I believe it has been made part of the standard and can be used in array-formulae. Cheers, Rofeu
  11. Rofeu

    Date Calculation help

    No need for testing the value. You can calculate it directly. select dateadd(d,-(datepart(dw,getdate()-(7-@@datefirst))+6),getdate()) [StartDate] , dateadd(d,-(datepart(dw,getdate()-(7-@@datefirst)) ),getdate()) [EndDate] Cheers, Rofeu
  12. Rofeu

    Date Calculation help

    No apologies necessary, George. My understanding of the lifetime of these settings was flawed. (doesn't take away that the OP can use them for his problem) Cheers, Rofeu
  13. Rofeu

    Date Calculation help

    That reminds me, you can use @@DATEFIRST to determine which day your instance uses as the starting day of the week, or use SET DATEFIRST to modify it as you wish. (take care that this changes the setting for the sqlserver, not just for your query!) Cheers, Rofeu
  14. Rofeu

    Date Calculation help

    check out the datepart,dateadd, and getdate functions. You should be able to figure it out. Cheers, Rofeu
  15. Rofeu

    Work out last race winner

    Hi, there seems to be a logical inconsistency in your example. Does Winnerlast3 mean: Did the dog win the last 3 races? OR Did the dog win one of the last three races? In case 1 the last record is incorrect in case 2 records 2 and 3 are incorrect. Please clarify. In case 2 you could use...

Part and Inventory Search

Back
Top