Page 3 of 3 FirstFirst 123
Results 31 to 36 of 36
  1. #31
    unclemeat is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2023
    Posts
    17
    hi bob
    this is the screenshot of the query i was using. i used a date of 28/03/2023.
    in the results i got a number of results showing dates before that.
    i get 283 results - both if i open the reports f form and put that date in, OR if i dont and just add 28/03/2023 as a parameter when asked.


    the correct result is 105 results, which you get if i revert to my original >[Forms]![reports f]![date] formula in the query (NB : you ONLY get this result entering the date as a parameter if form reports f is not open. if reports f is open you get the 283 results.





    Quote Originally Posted by unclemeat View Post
    hi Bob
    sorry im not ignoring you - i was just trying to get the tables you mentined put in etc. i did read the pge you suggested as well as watched a couple of richard rost youytube vids.

    the query did work, it just gives the wrong set of results - ill take a screen shot of the query for you shortly.
    appreciating the help.
    thx
    rob
    Attached Thumbnails Attached Thumbnails Screenshot 2023-04-09 16.32.13.jpg  

  2. #32
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    OK, can we have the latest DB then?
    As the one I have has a timestamp in RecordCreated for shopify, so will NEVER match just a date?
    Issue Date is even a text field?????

    How many are you meant to get in shopify for 6th March 2023?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #33
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    OK, got to the bottom of it. [Phew:]

    In the form you have a default value for date (stupid name btw, as it is a reserved name) as ='01/01/2022'
    If you click the calendar icon on the form, it opens to that date. Even when you put 01/04/2023 in the form, the value still comes up as 01/01/2022. Tested that in the immediate window and then removed the default and tested again.

    Once that default was removed, the query behaves as it should. Well in fact it has always been behaving as it should, it was just getting the incorrect data to work with.
    Attached Thumbnails Attached Thumbnails Dates.PNG  
    Last edited by Welshgasman; 04-09-2023 at 11:48 AM.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #34
    unclemeat is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2023
    Posts
    17
    thank you - i will change the name of the default value and leave it blank.
    lots of queries to alter too.
    cheers - ill be back with questions about my normalising im sure.


    Quote Originally Posted by Welshgasman View Post
    OK, got to the bottom of it. [Phew:]

    In the form you have a default value for date (stupid name btw, as it is a reserved name) as ='01/01/2022'
    If you click the calendar icon on the form, it opens to that date. Even when you put 01/04/2023 in the form, the value still comes up as 01/01/2022. Tested that in the immediate window and then removed the default and tested again.

    Once that default was removed, the query behaves as it should. Well in fact it has always been behaving as it should, it was just getting the incorrect data to work with.

  5. #35
    unclemeat is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2023
    Posts
    17
    hi welshgasman
    is there any way of getting queries to look up a field like that when i input the date. i have a macro that runs through about 5 queries all of which are looking for a date - i can input them when the parameter box comes up but it would be preferable if i only had to do it once and all the queries could look somewhere for the date.
    ta
    rob

  6. #36
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Just refer to the form as you were doing. No need for any formatting, just enter the date as normal.

    Edit: Form does need to be open for that to work though.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query giving strange results
    By deepakg27 in forum Queries
    Replies: 3
    Last Post: 02-11-2018, 11:17 AM
  2. Search Query not giving all results
    By wrkadri in forum Queries
    Replies: 5
    Last Post: 02-05-2013, 12:37 AM
  3. Calculation in Query giving wrong results
    By dargo72 in forum Queries
    Replies: 11
    Last Post: 11-07-2012, 05:39 AM
  4. Replies: 3
    Last Post: 07-13-2012, 09:18 AM
  5. Access giving wrong result using sql query
    By amlanroy in forum Access
    Replies: 3
    Last Post: 05-10-2012, 10:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums