Search results

  1. H

    Update first record for a number

    Hey CJ_London, for the first part: I didn't know to what [sapsys_SAPNr] could be equal. I only wanted to have something like "find first [sapsys_SAPNr]" having that ordering in my table. It were just my thoughts, I didn't know how to code that :/ But honestly I'm not really sure how I can...
  2. H

    Update first record for a number

    Thanks for your answer. When I apply that on my code I have to open a recordset like this: Set rst = dbs.OpenRecordset("SELECT * FROM tblSAPSys Order By sapsys_SAPNr ASC, sapsys_calenderdate ASC, sapsys_autoid DESC", dbOpenDynaset) .. right? :) After this, is my following code correct? Or how...
  3. H

    Update first record for a number

    Hey CJ_London, thank you for your answer and explanation (and sorry for my late reply). The only order I wanted to apply is ordering the table by the column calenderdate. If he goes from the top of the table to bottom then it has the right order for the order numbers in column sapsys_SAPNr...
  4. H

    Update first record for a number

    Hello community, I have an issue with a recordset that I'm trying to solve but I somehow struggle with it. Couple of weeks ago the user arnelgp helped me out with a similar problem but I have troubles applying his method to my "new" situation. What I want to do is: I want to compare dates...
  5. H

    Update second record

    @arnelgp: Thanks a lot again for your help, I will test it tomorrow and tell you if it worked :)
  6. H

    Update second record

    Hello, I want to update a table and created an update procedure to do that: If Not rstDaten.NoMatch Then DoEvents Do While (varOrderNumber = ![sapsys_SAPNr] And ![sapsys_KMATID] = varMatID) If ![sapsys_date] <>...
  7. H

    Adjust Calculating Quarter

    Thanks a lot for your great help, Uncle Gizmo! :) After a lot of attempts I finally got it working for me :) UPDATE tblSAPSys SET sapsys_quarter = IIf (("Q" & Format([sapsys_date],'q')) = "Q4", "Q1", ("Q" & Format([sapsys_date],'q')) +1);
  8. H

    Adjust Calculating Quarter

    Hello community, I've a short question: I've some code with which I can calculate the quarter from a date: sapsys_quarter = "Q" & Format([sapsys_date],'q') The thing is that "our" first quarter starts on October 1st and not January 1st. So right now we're in quarter 1 and not quarter 4. How...
  9. H

    how to check if value already exists in the past

    Hey arnelgp, it's me again. I wanted to expand the code a little bit and I guess I need your help for that again :) It's about this part: If ![sapsys_date] <> rstDaten![Kalendertag] And ![sapsys_KMATID] = rstDaten![MaterialID] Then .Edit...
  10. H

    how to check if value already exists in the past

    Thank you again, arnelgp for your amazing help! And sorry I couldn't write back earlier. I made some adjustments to your code and so far it works very well. But I have to do some more tests when I'm back at work on Monday. If I need more help I will come back to you again :) So far, thanks a...
  11. H

    how to check if value already exists in the past

    Thank you again, arnelgp, for your great help! :) So the code works and most of it is correct. When testing my data I stumbled upon one situation where it didn't really work I guess. Look at this order number: It was placed Nov 10th and changed Nov 11th two times. In my other table it wrote...
  12. H

    how to check if value already exists in the past

    Thanks a lot for the code!! I know you did a great job, but it is not completely working. When I execute it Access starts loading and loading, but nothing happens. It's not responding anymore. I think it got stuck in a loop or something like that. I also fixed the code a lil bit, there were...
  13. H

    how to check if value already exists in the past

    Anything that solves this problem is good for me :) tblDatenAusExcelNeu has no auto number. Here I don't need this because I analyze this table every time and delete it and write new entries in it.
  14. H

    how to check if value already exists in the past

    You can also check for the id, it's an automatically generated number. So this is the table where I want to have the date changed: Right now I insert the order number and the date when the order was placed into this table. The date comes from this table: So my job is to bring two date...
  15. H

    how to check if value already exists in the past

    Thank you again, arnelgp, for the code. This time it took all the dates from column Kalendertag and changed the dates in column sapsys_date. So the end result is this: But based on my table with the dates it should write Oct 14th into line 1 and Oct 19th into the second and third line. This...
  16. H

    how to check if value already exists in the past

    Thank you for your help :) Unfortunately it didn't help :( See, I have this table: In column Verkaufsbeleg there are my order numbers, AngelegtAm is the date when the order was placed and Kalendertag is the date when the order was changed. In my other table the date hasn't changed after...
  17. H

    how to check if value already exists in the past

    Hello, I want to update a column by checking a condition if an order number already exists in the past. I coded some SQL but it doesn't work how I want :( UPDATE tblSAPSys AS a INNER JOIN tblDatenAusExcelNeu AS b ON a.sapsys_SAPNr = b.Verkaufsbeleg SET a.sapsys_date = b.Kalendertag WHERE...
  18. H

    Change data type to date

    Thank you for your answers. I figured out a solution that works better: I'm going to prepare a table with my demanded field types and afterwards I will be copying the data from my imported table to the prepared one. Only one question I have left: How can I insert from a text column into a date...
  19. H

    Change data type to date

    Hello, I have an imported table from Excel with three columns I want to change the data type of. To do that I use the code CurrentDb.Execute "ALTER TABLE [tblOrders] ALTER COLUMN [MaterialID] DOUBLE" But now I want to change one column to date with this format: mm.yyyy and the other one...
  20. H

    Excel 2010 - Find last used cell in range

    @Brianwarnock: I know you did say that :) And it works like a charm now, so everything is good. Thanks a lot, to all of you =)
Back
Top Bottom