Results 1 to 8 of 8

Thread: [RESOLVED] Very Strange Select Error

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    307

    Resolved [RESOLVED] Very Strange Select Error

    guys i have a strange error....ok well i know what the error means but dont why its happening. my code is:
    VB Code:
    1. sstr = "select VideoTape.DateAdded, VideoTape.Issues, VideoTape.Barcode, VideoBase.Title from VideoBase, VideoTape " & _
    2.            "Where VideoBase.Code = VideoTape.Base " & _
    3.            "AND DateValue(VideoTape.DateAdded) Between " & "#" & DateValue(aCrit1) & "#" & _
    4.            " AND " & "#" & DateValue(aCrit2) & "#" & _
    5.            " AND VideoTape.Issues <= " & aCrit3 & _
    6.            " AND VideoTape.Deleted = No" & _
    7.            " AND VideoBase.Deleted = No" & _
    8.            " Order By VideoTape.DateAdded"

    then to execute it i say
    VB Code:
    1. Set rsx = Datacc.GetVideoIssues(DTPicker1.Value, DTPicker2.Value, Text1.Text)

    simply enough yes? yes......now dtpicker1 and 2's values are fine. text1 is what i use to specify the issue amounts. now if i enter values 1, 2, 3 etc. to 7 it works perfectly. then i enter value 8 and it gives me a Data Type Mismatch error in criteria expression. then i enter 9 - whatever and it also works perfectly.

    anyone know why it bombs out only on 8? i checked in the database and there are issues that went out 8 times. so its very very strange.

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Very Strange Select Error

    Is this Access? If yes then have you tried Compact and Repair already?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    307

    Re: Very Strange Select Error

    yes its access.....no i havent tried it yet, will try it with a copy of database coz other users are using the db at the moment.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    307

    Re: Very Strange Select Error

    nope same result

  5. #5
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Very Strange Select Error

    I'm not sure but how about checking for the value of aCrit3 before the sql?

    VB Code:
    1. Msgbox aCrit3
    2. sstr = "select VideoTape.DateAdded, VideoTape.Issues, VideoTape.Barcode, VideoBase.Title from VideoBase, VideoTape " & _
    3.            "Where VideoBase.Code = VideoTape.Base " & _
    4.            "AND DateValue(VideoTape.DateAdded) Between " & "#" & DateValue(aCrit1) & "#" & _
    5.            " AND " & "#" & DateValue(aCrit2) & "#" & _
    6.            " AND VideoTape.Issues <= " & aCrit3 & _
    7.            " AND VideoTape.Deleted = No" & _
    8.            " AND VideoBase.Deleted = No" & _
    9.            " Order By VideoTape.DateAdded"
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    307

    Re: Very Strange Select Error

    msgbox returns 8....i checked the db and it is declared a Long Integer, and i declared aCrit3 as long as well. even tried Trim(aCrit3). then i added this to the code:
    VB Code:
    1. " AND VideoTape.Issues >= " & aCrit3 & _
    2. " AND VideoTape.Issues <= " & aCrit4 & _

    and searched between 9 and 10000000 with no error what so ever. have no idea why its doing dat.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    307

    Re: Very Strange Select Error

    maybe its not issues giving the problem....gonna see if all date's added has a value in it......

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    307

    Re: Very Strange Select Error

    hehehe thats just great!......one empty dateadded field and wouldnt you know it....went out 8 times!

Posting Permissions

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



Click Here to Expand Forum to Full Width