Getting all the files within the month

igloo iguana

Member
Joined
Feb 12, 2003
Messages
11
Location
Arkansas
I have a database that has a date column.
I have a form that has a date picker on it.
I want to use the date picker to pull all files from the month chosen.
The date format in the database is 01/01/2003
The date picker format is 01/01/2003
How do I get all the files within the month?

This is a reservation system and I need to list all reservations that happened within the month selected.

Thanks

p.s. i kinda need this pretty fast also.
:D
 
I had someone tell me about this (value.date) thing so I tried it and it worked.
selectFormula = "{Ticket.Flight_date} >= #" & monthPicker.Value.Date & "# And {Ticket.Flight_date} <= #" & monthPicker2.Value.Date & "# And {Customer.Customer_ID} = " & cboCustomerSSN.Text & " "

I am going to try your code tomorrow.
I want to see if the month is any different than the date.

Thanks;)


Dim frmCustomerSummary As New frmCustomerSummary()
frmCustomerSummary.Show()
Dim report As New ReportDocument()
Dim selectFormula As String
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
Try
report.Load("..\CrystalReport_customer_month.rpt")
For Each tbCurrent In report.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = "someservername"
.UserID = "someuserid"
.Password = "somepassword"
.DatabaseName = "somedatabasename"
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent
selectFormula = "{Ticket.Flight_date} >= #" & monthPicker.Value.Date & "# And {Ticket.Flight_date} <= #" & monthPicker2.Value.Date & "# And {Customer.Customer_ID} = " & cboCustomerSSN.Text & " "
report.DataDefinition.RecordSelectionFormula = selectFormula
frmCustomerSummary.CrystalReportViewer1.ReportSource = report
frmCustomerSummary.CrystalReportViewer1.Zoom(100)
Catch Exp As LoadSaveReportException
MsgBox("Crystal Reports has failed to load please try again.", MsgBoxStyle.Critical, "ERROR")
Catch Exp As Exception
MsgBox(exp.Message, MsgBoxStyle.Critical, "ERROR")
End Try
 
Back
Top