Hello,
I have the following table:
U I AbsTime TypeOfFile
2 0.01 0000001 000001-D00
3 0.01 0000002 000001-D00
4 0.01 0000003 000002-D00
7 0.02 0000004 000003-D00
5 0.03 0000005 000001-D04
6 0.01 0000006 000002-D04
8 0.01 0000008 000001-D00
9 0.02 0000010 000001-D00
On my form i have a combo box which uses the following SQL code:
This code lists, based on the table above, the following in the combo box:
000001-D00
000002-D00
000003-D03
000001-D04
000002-D04
The problem i have is that the second time a file of type 000001-D00 is read into the table (as seen above) my SQL code doesn't separate those from the other 000001-D00's that are already in the table.
I have written a function ReturnDate() that takes a time parameter for the current record and returns a date that is relative to a preset date. See Code below.
What i would like to do is to extend the sql code so that the combo box would include a 'date-tag' so i wont miss out on file types of same type but from different dates. So with the new code the combo box would look something like this:
2011-02-02 000001-D00
2011-02-10 000001-D00
2011-01-01 000002-D00
2011-03-02 000003-D03
2011-02-02 000001-D04
2011-02-01 000002-D04
It is good enough if the first AbsTime record is sent in as parameter to the function for each type of file.
How would i go on doing this?
Any help is much appreciated, hope the explanation is clear.
Thanks heaps
I have the following table:
U I AbsTime TypeOfFile
2 0.01 0000001 000001-D00
3 0.01 0000002 000001-D00
4 0.01 0000003 000002-D00
7 0.02 0000004 000003-D00
5 0.03 0000005 000001-D04
6 0.01 0000006 000002-D04
8 0.01 0000008 000001-D00
9 0.02 0000010 000001-D00
On my form i have a combo box which uses the following SQL code:
Code:
SELECT DISTINCT TableData.TypeOfFile FROM TableData WHERE (((TableData.TypeOfFile) Is Not Null)) ORDER BY TableData.TypeOfFile
000001-D00
000002-D00
000003-D03
000001-D04
000002-D04
The problem i have is that the second time a file of type 000001-D00 is read into the table (as seen above) my SQL code doesn't separate those from the other 000001-D00's that are already in the table.
I have written a function ReturnDate() that takes a time parameter for the current record and returns a date that is relative to a preset date. See Code below.
Code:
Public Function ReturnDate(T_End As Double) As Date Dim FirstDate As Date ' Declare variables. Dim IntervalType As String Dim T_Seconds As Double Dim T_start As Double T_start = 815910630 IntervalType = "s" ' "s" specifies months as interval. FirstDate = "2010-10-21 15:00" T_Seconds = T_End - T_start ReturnDate = DateAdd(IntervalType, T_Seconds, FirstDate) End Function
2011-02-02 000001-D00
2011-02-10 000001-D00
2011-01-01 000002-D00
2011-03-02 000003-D03
2011-02-02 000001-D04
2011-02-01 000002-D04
It is good enough if the first AbsTime record is sent in as parameter to the function for each type of file.
How would i go on doing this?
Any help is much appreciated, hope the explanation is clear.
Thanks heaps
Comment