Ask User to input the DATE in Macro (1 Viewer)

mansied

Member
Local time
Today, 11:39
Joined
Oct 15, 2020
Messages
99
Hello
I've added this line in my macro to ask user to input the date. It repeat two times in my macro .!!
I 've changed it many many times .but ... .I have the same code in another database which comes up one time !
could you help me what is wrong ?( the correct date should be 2022-01-01 : first day of the month )


UPDATE [Report_Date] SET [Report_Date].[Date] = DateSerial(Year([report Date (ex: 1 Jan 2022)]),Month([End Date (ex: 1 Jan 2022)]),Day([End Date (ex: 1 Jan 2022)]));


1639155505960.png

Thank you so much
 

Ranman256

Well-known member
Local time
Today, 11:39
Joined
Apr 9, 2015
Messages
4,339
have the user input the date in a form (once) , then all queries can use THAT date.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:39
Joined
Oct 29, 2018
Messages
21,360
Also, maybe you can save the query and use OpenQuery instead of RunSQL.
 

Gasman

Enthusiastic Amateur
Local time
Today, 15:39
Joined
Sep 21, 2011
Messages
14,056
Can you really have ex 1 Jan 2022 in SQL ???
 

CJ_London

Super Moderator
Staff member
Local time
Today, 15:39
Joined
Feb 19, 2013
Messages
16,555
the reason it comes up twice is because you have two different parameters

[report Date (ex: 1 Jan 2022)]
[End Date (ex: 1 Jan 2022)]
 

Users who are viewing this thread

Top Bottom