|
-
February 10th, 2004, 12:48 PM
#1
***** Null Values (Include or skip?) *****
I'm having trouble working with a SQL Server 2000 field that has a space called:
Support date
Another problem is with a table full of <Nulls>. In my RecordSelectionFormula: I have #'s and CDate's because the field's datatype is nvarchar, not DateTime.
Two questions:
1) How can I include this field in my RecordSelectionFormula:
Support date
Use square brackets? [ ]
2) Regarding the <Nulls> in the database, I know of the IsNull function but how would I create an "If....Then....Else" statement that will either a) skip over the <nulls> or b) include the <nulls>?
Here is my code so far, there are two DateTimePickers so that I will be able to filter through specific dates.
Code:
Private Sub cmdSupportDate_Company_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSupportDate_Company.Click
Dim strStartDate As String
Dim strEndDate As String
'Starting Date
strStartDate = DateTimePickerSupportDate_CompanyStart.Value
strEndDate = DateTimePickerSupportDate_CompanyEnd.Value
'Ending Date
Dim objSupportDate_Company As CrystalDecisions.CrystalReports.Engine.ReportDocument
objSupportDate_Company = New crSupportDate_TicketNumber()
objSupportDate_Company.DataDefinition.RecordSelectionFormula = "CDate({[TD3.Support date]}) >=#" & strStartDate & "# and CDate({[TD3.Support date]}) <=#" & strEndDate & "#"
ReportViewerSupportDate_Company.ReportSource = objSupportDate_Company
ReportViewerSupportDate_Company.RefreshReport()
'Refresh report based on new date range criteria
End Sub
Thanks in advance,
Chris
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
|
Click Here to Expand Forum to Full Width
|