silentwolf
Active member
- Local time
- Today, 09:00
- Joined
- Jun 12, 2009
- Messages
- 644
Hi guys,
I am not really sure how to achieve this in the easiest way.
What I like to achieve is to get min Date of a table and max Date of the same table and create a FileName out of it.
I import a File which has in one field all dates...
So do I need to create a query for the Start Date and one for the End Date with Min and Max function or is there a better way?
Do I even need all those Properties or can I short cut it in a better way?
Hope someone could help me with this.
Many thanks
I am not really sure how to achieve this in the easiest way.
What I like to achieve is to get min Date of a table and max Date of the same table and create a FileName out of it.
Code:
Private m_startDate As String
Private m_endDate As String
Private m_year As String
Private m_fileName As String
'
Public Property Let StartDate(ByVal datStart As Date)
m_startDate = datStart
End Property
Public Property Get StartDate() As Date
StartDate = m_startDate
End Property
Public Property Let EndDate(ByVal datEnd As Date)
m_endDate = datEnd
End Property
Public Property Get EndDate() As Date
EndDate = m_endDate
End Property
Public Property Let StatYear(ByVal datYear As Date)
m_year = datYear
End Property
Public Property Get StatYear() As Date
StatYear = m_year
End Property
Public Property Let FileName(ByVal strFileName As String)
m_fileName = strFileName
End Property
Public Property Get FileName() As String
FileName = m_fileName
End Property
Sub test()
StartDate = #1/4/2022#
EndDate = #12/31/2022#
StatYear = #12/31/2022#
FileName = Format(StartDate, "MMM") & Format(EndDate, "MMM") & Format(StartDate, "YYYY")
Debug.Print FileName
End Sub
I import a File which has in one field all dates...
So do I need to create a query for the Start Date and one for the End Date with Min and Max function or is there a better way?
Do I even need all those Properties or can I short cut it in a better way?
Hope someone could help me with this.
Many thanks