Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...