0
I have a table with several information and another empty.
I need to do an INSERT in this empty table with only one information from the other table, but SELECT has to be random.
I am using the following line in VBA:
db.Execute "INSERT INTO tbl_Sorteio SELECT TOP 1 RE, Name_Employee, Case_Number, [Date], [Time], Supervisor, Comment, Client ORDER BY Rnd(Case_Number)"
However I got the following error message:
Remembering, I’m using Access 2013.
Good morning caique, how so select random? tried to put variables in select?
– Luiz Augusto
Tried : ... order by Rnd"
– Motta
Luiz, in the above case there was no FROM table in SELECT, but it is not 100%. The ORDER BY Rnd(Case_number) server to take a random number from the select table and insert it into the draw table. However I need to define in WHERE a range of dates, but it is not working. I do not know if it is Rnd() that does not work with WHERE or some other problem.
– caiquelcn
SELECT
random? What do you mean?? In your query missing aFROM
specifying the table where you are going to get the information.– João Martins
@caiquelcn, managed to walk with the problem? the answer helped??
– rLinhares