Search results

  1. B

    Calculate months between two dates in SAS

    Hi all, somehow I can't calculate the months between 20211231 and 20230228. %let End = %sysfunc(intnx(month,%sysfunc(today()),-4,e),YYMMDDN8.); %let Begin = %sysfunc(intnx(year, %sysfunc(date()), -2, e),YYMMDDN8.); %put &Begin; %put &End; %let count_months...
  2. B

    Filtering a numeric column name in SAS SQL

    Hi all, I was trying to select a reporting month column from table temp_trans, it looks like: GPNr 202112 202201 202202 .... 202208 x 1 5 2 ... 3 y 0.4 2 3 8 z 3 1 5 ... 6...
  3. B

    Update current record with next record value

    Many Thanks Arnelgp, forgot to mention I'm trying this in SAS. Somehow SELECT TOP 1 doesn't work out here. Any clue how to adjust this? Thanks.
  4. B

    Update current record with next record value

    Hi all, I want to identify the time frame of a agent's job. For example Agent 081 had a task aaa from 202012-202104, then it switched to task vvv from 202104 until now 202102. I found this code: data want; recno=_n_+1; set Task_times end=last; if not last then set...
  5. B

    Solved Get first observation of dataset

    Hello all, how can I get the first appearance of this dataset via SQL? 202012 0821 Ein 202106 0821 Mehr Thank you in advance. Kind regards, Ben
  6. B

    Solved Method 'Cells' of object '_Global' failed in Excel session opened via Access

    Thank you, that was the missung point. You made my day :) Regards, Ben
  7. B

    Solved Method 'Cells' of object '_Global' failed in Excel session opened via Access

    This also doesn't work :( sht.Range(Cells(2, 3), Cells(" & lastrow_BD & ", " & lastcolumn_BD - 1 & ")).Select
  8. B

    Solved Method 'Cells' of object '_Global' failed in Excel session opened via Access

    I replaced it by sht2.Columns("C:C").Select now this works. However the select statement later on makes issues: oExcel.Range(Cells(2, 3), Cells(" & lastrow_BD & ", " & lastcolumn_BD - 1 & ")).Select or sht.Range(Cells(2, 3), Cells(" & lastrow_BD & ", " & lastcolumn_BD - 1 & ")).Select...
  9. B

    Solved Method 'Cells' of object '_Global' failed in Excel session opened via Access

    It opens both Excel files out of Access. I'm using this: Dim oExcel As Object Dim oBook As Object Dim oBook2 As Object Dim lastcolumn_BD, lastrow_BD As Long Dim lastcolumn_BD2, lastrow_BD2 As Long Dim sht As Object Dim sht2 As Object Set oExcel = CreateObject("Excel.Application")...
  10. B

    Solved Method 'Cells' of object '_Global' failed in Excel session opened via Access

    Thank you for the feedback. Unfortunately your proposed changes doesn't work out yet. I found out that this explicit code makes issues: It calculates the lastrow and lastcolum but breaks at the select statement: lastrow_BD = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row lastcolumn_BD =...
  11. B

    Solved Method 'Cells' of object '_Global' failed in Excel session opened via Access

    Dear all, from time to time this code doesn't run giving the error message: Method 'Cells' of object '_Global' failed It opens both Excel tables, but it fails to insert a column. Every help is much appreciated. Thank you. Regards, Ben Public Sub Format_BD_Excel() 'Get all Excel files in...
  12. B

    Recordset Operation

    I was handling with this for two weeks. A suitable matching key is missing. On the one hand I got a data based on reporting months on the other hand data based on time periods. Can't avoid duplicates, at least I could convince a colleague that's not possible. At the end 2 weeks waste of time...
  13. B

    Recordset Operation

    As a next step I have to take the period information and replace.it with the above record. Afterwards I could delete the marked recordset. TA-1012 cihazımdan Tapatalk kullanılarak gönderildi
  14. B

    Recordset Operation

    Hi Mark, Thanks for the hint. But I need it in a program at the end. It has to run automatically every month. TA-1012 cihazımdan Tapatalk kullanılarak gönderildi
  15. B

    Recordset Operation

    Thank you but it still doesn't work. Booking Costs Period Dupl edited BC 222 22018 BC 76867 22018 AZ 34132 102018 AZ 41234 102018 MK 43214 32018 x MK 523 32018 MK 54134 32018 no current record error message jumping at .Movenext
  16. B

    Recordset Operation

    Period is a text field TA-1012 cihazımdan Tapatalk kullanılarak gönderildi
  17. B

    Recordset Operation

    Unfortunately ıt still doesn't work out. Booking Costs Period Dupl edited BC 222 22018 BC 76867 22018 AZ 34132 102018 AZ 41234 102018 MK 43214 32018 x MK 523 32018 MK 54134 32018 It gıves the error message: Run tıme error 3021: No current record
  18. B

    Recordset Operation

    Thanks for the post. Unfortunately it doesn't run through. Run-time error 3061: Too few parameters. Expected 1. Can you advise? Thank you.
  19. B

    Recordset Operation

    Hi all, I got following issue: There are two tables called Result and Duplicates. Now I want to mark all duplicated in the Result table. Here the content: RESULT TABLE (my goal): Booking Costs Period Dupl edited BC 2089 22018 BC 2089 22018 x AZ...
  20. B

    Run Access VBA code from .bat file

    Thank you all for the help. I've found a hot fix. The sub is copied to the new opened database, runs it there and deleted after the run. Now it works. Thank you. Kind regards, Ben
Top Bottom