Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2003
    Posts
    225

    Unanswered: recieving error when running query

    I am getting an error when i try to use two dates that are entered into a form

    Error

    http://members.lycos.co.uk/redtilefc/error2.jpg

    my form name is frm_LME

    and my text boxes on the form are called


    Datestart
    DateEnd


    and the query i am trying to run is as follows:

    Between [Forms]![frm_LME]![DateStart] And [Forms]![frm_LME]![Dateend]


    can anyone see where i am going wrong please

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try

    Between CDate([Forms]![frm_LME]![DateStart]) And CDate([Forms]![frm_LME]![Dateend])

  3. #3
    Join Date
    Mar 2003
    Posts
    225
    thanks, but that didn't work.....

    right here goes......

    i have a number of queries.

    queryLME2 - (Works Fine)


    Daycode, Line, Machine, TtlTime: [tblEvents]![MinorStop]+[tblEvents]![MajorStop]+[tblEvents]![Breakdowns]+[tblEvents]![CIP]+[tblEvents]![ProductChange]+[tblEvents]![Maintenance]

    LME Crosstab

    Daycode - Row Heading - queryLME2 - groupby
    Line - Row Heading - queryLME2 - groupby
    Machine - Colomn Heading - queryLME2 - groupby
    PlannedTime -Row Heading - tblProduction - groupby
    Impressions -Row Heading - tblProduction - groupby
    Sum of Time - Value - queryLME2 - sum
    Total Of TtlTime: Sum([TetraLME2]![SumOfTtlTime]) - Expression - Row heading


    LME Final: (Query) all data taken from the crosstab above

    Daycode
    Line
    Planned time
    Impressions
    Downtime
    Line Lme
    Machine1LME
    Machine2LME
    and so on.......

    it all works fine UNTIL i put the date reference in, as soon as i use


    Between [Forms]![frm_LME]![DateStart] And [Forms]![frm_LME]![Dateend]


    it all falls apart on me and it stops.

    HELP!!!!

  4. #4
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    Where are you calling the criteria from?

  5. #5
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile

    Originally posted by Chimp8471
    thanks, but that didn't work.....

    right here goes......

    i have a number of queries.

    queryLME2 - (Works Fine)


    Daycode, Line, Machine, TtlTime: [tblEvents]![MinorStop]+[tblEvents]![MajorStop]+[tblEvents]![Breakdowns]+[tblEvents]![CIP]+[tblEvents]![ProductChange]+[tblEvents]![Maintenance]

    LME Crosstab

    Daycode - Row Heading - queryLME2 - groupby
    Line - Row Heading - queryLME2 - groupby
    Machine - Colomn Heading - queryLME2 - groupby
    PlannedTime -Row Heading - tblProduction - groupby
    Impressions -Row Heading - tblProduction - groupby
    Sum of Time - Value - queryLME2 - sum
    Total Of TtlTime: Sum([TetraLME2]![SumOfTtlTime]) - Expression - Row heading


    LME Final: (Query) all data taken from the crosstab above

    Daycode
    Line
    Planned time
    Impressions
    Downtime
    Line Lme
    Machine1LME
    Machine2LME
    and so on.......

    it all works fine UNTIL i put the date reference in, as soon as i use


    Between [Forms]![frm_LME]![DateStart] And [Forms]![frm_LME]![Dateend]


    it all falls apart on me and it stops.

    HELP!!!!
    Use a message box to display the statement that you are trying to use.
    Then use your query and enter some dates into it. Look at the SQL statement that is generated and compare with your message box result.
    You may have to concatenate some # signs in there so they will be referenced as dates.

    My 2 cents.

    Gregg

  6. #6
    Join Date
    Mar 2003
    Posts
    225
    here is an axample
    Attached Files Attached Files

Posting Permissions

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