A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
The link in the post works for me, however you can get it from http://www.gmayor.com/Forum/CalendarForm v1.5.2.xlsm
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am using VBA Code: in that I need to take users input in below format:
'06-May-16' and '11-May-16'
(every time users input will be different)
because in VBA, we are going to fire SQL which will have below condition:
AND TRUNC (start_time) BETWEEN '06-May-16' AND '11-May-16' ( users input should come here directly)
but I am not getting any way, please help me with this.
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
The link in the post works for me, however you can get it from http://www.gmayor.com/Forum/CalendarForm v1.5.2.xlsm
Answer accepted by question author
Hi,
try and this...
Dim Date1 As Long, Date2 As Long
Dim sDate1 As String, sDate2 As String
Date1 = DateSerial(2016, 5, 6)
Date2 = DateSerial(2016, 5, 11)
sDate1 = Format(Date1, "dd-mmm-yy")
sDate2 = Format(Date2, "dd-mmm-yy")
please help on same
I would be inclined to create a simple userform with two text fields to collect the two dates with a date picker - I particularly like Trevor Eyre's VBA date picker - http://bit.ly/1ossyMA. You can easily format the output of the two date text boxes to give you the format you require for your SQL string e.g. something like
strDate1 = Format(TextBox1.Text, "'dd-mmm-yy'")
strDate1 = Format(TextBox2.Text, "'dd-mmm-yy'")
AND TRUNC (start_time) BETWEEN " & strDate1 & " AND " & strDate2
or don't even bother with the userform and call the date picker directly from your code e.g. using Trevor's code
Dim strDate1 As String, strDate2 As String
strDate1 = Format(BasicCalendar(Date), "'dd-mmm-yy'")
strDate2 = Format(BasicCalendar(Date), "'dd-mmm-yy'")