A date-time is required here. Crystal Report

Posted on 2006-04-05
Last Modified: 2008-01-09
I am passing the record selection forluma using the following code:
 report.DataDefinition.RecordSelectionFormula =
"{trans_dtl_conso.transaction_date}='" & Format(dtpFrom.Value, "MM-d-yyyy")  & "'"

Following error message appears:
A date-time is required here.
Error in File file name dot rpt;
Error in formula <Record_Selection>.
A date-time is required here.

datastruce of transaction_date is datetime in sqlserver.
I want to validate only the date.
Question by:peterdevadoss
    LVL 4

    Accepted Solution

    within crystal you probably need to use #03-1-2006# to pass the date; you are just passing a formula to crystal, crystal is talking to sql
    LVL 34

    Assisted Solution

    by:Brian Crowe
    johnson is correct try...

    report.DataDefinition.RecordSelectionFormula =
    "{trans_dtl_conso.transaction_date}=#" & dtpFrom.Value.tostring("MM-d-yyyy")  & "#"

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now