-
Newbie: Needs help with SQL Date Range in Crystal Report
The following works but it's not the best way to do it.
SQL would be better!
rs2.MoveFirst
Do Until rs2.EOF = True
If rs2.Fields("Batch_Date") >= wsFrDate And rs2.Fields("Batch_Date")
<= wsToDate Then
rs4.AddNew
rs4.Fields("SSN") = rs2.Fields("SSN")
rs4.Fields("Entry_Date") = rs2.Fields("Entry_Date")
rs4.Fields("Batch_Date") = rs2.Fields("Batch_Date")
Data1.Recordset.Index = "ndxSSN" ' primary index
rs1.Seek "=", rs2.Fields("SSN")
rs4.Fields("Name") = rs1.Fields("Name")
rs4.Fields("Ins_Plan") = rs2.Fields("Ins_Plan")
Data3.Recordset.Index = "ndxInsPlan" ' primary index
rs3.Seek "=", rs2.Fields("Ins_Plan")
rs4.Fields("Desc") = rs3.Fields("Desc")
rs4.Fields("Payment") = rs2.Fields("Payment")
rs4.Fields("Category") = rs2.Fields("Category")
rs4.Update
End If
rs2.MoveNext
Loop
Need Help!
Magic
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks