Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Norfolk, England
    Posts
    744
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exporting Issue (2000)

    Hi,
    Attached is a really stripped database that Hans kindly helped me with in the past.
    On FrmExport the user is prompted to select a Year and Quarter. In the initial conception of the database the quarter were based on the financial year, so April to June (Quarter 1), July to Sept (Quarter 2) and so on.
    However it has now transpired that the quarters are:
    Q1) Nov to Dec
    Q2) Jan to March
    Q3) Apr to Jun
    Q4) Jul to Oct
    So I've altered QryQuarters to reflect this and to catch the appropriate months.
    In FrmExport, CboQuarter is based on QryQuarter thus selecting the appropriate months.
    The user then clicks on CmdExport which then exports the relevant data from TblMain and TblWitnesses (This data is entered via forms that have been deleted)
    However the folowing message is being displayed:

    Date Type mismatch in criteria expression

    And the report isn't produced. Help!!!!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Exporting Issue (2000)

    Change the line
    <code>
    " AND Format(DateAdd('m',-2,[DateOutcome]),'q')=" & Me.cboQuarter
    </code>
    to
    <code>
    " AND Format(DateAdd('m',-2,[DateOutcome]),'q')='" & Me.cboQuarter & "'"
    </code>
    The result of Format is a string, so you must enclose the value of Me.cboQuarter in quotes.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Norfolk, England
    Posts
    744
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Exporting Issue (2000)

    Thanks Hans.
    It still comes back with no records to export. From the data that I have on the full database there is data that falls with the criteria.
    Have I set the quarters incorrectly?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Exporting Issue (2000)

    In qryQuarters, you use DateAdd("m",2,[DateOutcome]) to define the year and quarter.
    In the SQL string you assemble in cmdExport_Click, you use DateAdd("m", -2, [DateOutcome]) to define the year and quarter.
    This explains the discrepancy. You must decide which of the two expressions is correct.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •