SELECT DateAdd("d",[dNumber],[pStartDate]) AS TheDays
FROM tblYourTable, tblCount
WHERE (((DateAdd("d",[dNumber],[pStartDate]))<=[pEndDate]))
ORDER BY DateAdd("d",[dNumber],[pStartDate]);
CDate(Format([TheDays],"q-yyyy"))
SELECT CDate(Format([TheDays],"q-yyyy")) AS ProjectQuarters
FROM qryGetProjectDays
GROUP BY CDate(Format([TheDays],"q-yyyy"));
Sub AddRecs()
Dim x As Integer
For x = 1 To 1724
CurrentDb.Execute "INSERT INTO tblCount(dNumber) VALUES(" & x & ")"
Next
End Sub
Fast way to add 1724 records:
Code:Sub AddRecs() Dim x As Integer For x = 1 To 1724 CurrentDb.Execute "INSERT INTO tblCount(dNumber) VALUES(" & x & ")" Next End Sub
Const SQL As String = _
"INSERT INTO Table1(data) VALUES( p0 )"
Dim i As Integer
DBEngine.BeginTrans
With CurrentDb.CreateQueryDef("", SQL)
For i = 1 To 1724
.Parameters(0) = i
.Execute
Next
.Close
End With
DBEngine.CommitTrans
[SIZE="1"]Sub AddRecs()
Const SQL As String = _
"INSERT INTO Table1(data) VALUES( p0 )"
Dim clock As Single
Dim i As Integer
clock = Timer
DBEngine.BeginTrans
With CurrentDb.CreateQueryDef("", SQL)
For i = 1 To 1724
.Parameters(0) = i
.Execute
Next
.Close
End With
DBEngine.CommitTrans
Debug.Print Format(Timer - clock, "0.000") & " in a transaction with a querydef"
clock = Timer
Dim x As Integer
For x = 1 To 1724
CurrentDb.Execute "INSERT INTO table1(data) VALUES(" & x & ")"
Next
Debug.Print Format(Timer - clock, "0.000") & " without a transaction or a querydef"
End Sub
[/SIZE]
Const SQL As String = _
"INSERT INTO Table1(data) VALUES( p0 )"
Dim i As Integer
DBEngine.BeginTrans
With CurrentDb.CreateQueryDef("", SQL)
For i = 1 To 1724
.Parameters(0) = i
.Execute
Next
.Close
End With
DBEngine.CommitTrans
No?Code:WHERE (((Tab_Project.StartDate)<[Tab_Project].[EndDate]));