M
Mario Krsnic
Hello everybody,
I have a following table structure:
Task (Text), 1(first day, integer), 2(second day,
integer) ...etc. 31 (31.day, integer), StartTime (Data/Time),
Monat(integer),
Jahr(integer)
All tasks, that have the same Start time belong to the same plan.
I should list all plans with their tasks
It should be the result:
Plan for 2th day: . StartTime: 07:00:00
Task 1
Task 2
Task 3
Plan for 2th day: . StartTime: 18:00:00
Task 7
Task 9
Task 11
Plan for 3th day: . StartTime: 07:00:00
Task 1
Task 2
Task 3
and so on...
I tried to solve the problem in this way with DAO and VB6. But maybe there
is some better sql-query for it?
Set rs = db.OpenRecordset("select * from TblTasks where Month= 4 und
ActYear= 2008")
dim Y%
For Y = 2 To 32
rs.MoveFirst
While Not rs.EOF
If rs(Y).Value > 0 Then
Text1 = Text1 & "Plan for " & Y - 2 & " . StartTime: " & rs!StartTime
& vbCrLf
Text1 = Text1 & "Task: " & rs!Task & vbCrLf
End If
rs.MoveNext
Wend
Next Y
I get the following result:
Plan for 2th day: . StartTime: 07:00:00
Task 1
Plan for 2th day: . StartTime: 07:00:00
Task 2
Plan for 2th day: . StartTime: 07:00:00
Task 3
How to list the result without repeting the text "Plan for 2th day: .
StartTime: 07:00:00
"
Is there any better sql-query or other solution?
Thanks in advance.
Mario
I have a following table structure:
Task (Text), 1(first day, integer), 2(second day,
integer) ...etc. 31 (31.day, integer), StartTime (Data/Time),
Monat(integer),
Jahr(integer)
All tasks, that have the same Start time belong to the same plan.
I should list all plans with their tasks
It should be the result:
Plan for 2th day: . StartTime: 07:00:00
Task 1
Task 2
Task 3
Plan for 2th day: . StartTime: 18:00:00
Task 7
Task 9
Task 11
Plan for 3th day: . StartTime: 07:00:00
Task 1
Task 2
Task 3
and so on...
I tried to solve the problem in this way with DAO and VB6. But maybe there
is some better sql-query for it?
Set rs = db.OpenRecordset("select * from TblTasks where Month= 4 und
ActYear= 2008")
dim Y%
For Y = 2 To 32
rs.MoveFirst
While Not rs.EOF
If rs(Y).Value > 0 Then
Text1 = Text1 & "Plan for " & Y - 2 & " . StartTime: " & rs!StartTime
& vbCrLf
Text1 = Text1 & "Task: " & rs!Task & vbCrLf
End If
rs.MoveNext
Wend
Next Y
I get the following result:
Plan for 2th day: . StartTime: 07:00:00
Task 1
Plan for 2th day: . StartTime: 07:00:00
Task 2
Plan for 2th day: . StartTime: 07:00:00
Task 3
How to list the result without repeting the text "Plan for 2th day: .
StartTime: 07:00:00
"
Is there any better sql-query or other solution?
Thanks in advance.
Mario