Date query working incorrectly (Reports - Charts)

davie1982

Board Regular
Joined
Nov 19, 2007
Messages
170
Office Version
  1. 365
  2. 2019
Hiya.

I have this code in a chart on one of my reports in the SQL query as a criteria.

Code:
>=[forms]![frmdatestuff]![txtstartdate] And <=[forms]![frmdatestuff]![txtenddate]

For some reason, if i want the chart to display for example 14.12.11 > 16.12.11 I place 14/12/11 in the [txtstartdate] input box and 16/12/11 in the [txtenddate] box. The problem is that the chart starts from 15/12/11. This isn't what I want. I'm having to put 13/12/11 in [txtstartdate]. It's like it's not registering the "=" in ">=". However, the end date works fine. Can anyone tell me where i've gone wrong?
 
It all failed, but I fixed it. The format I was using in the [txtstartdate] and [txtenddate] was dd/mm/yy. Changing this to dd/mm/yyyy solved my problem.
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Well I've never seen that, but I suppose there is room for confusion?

Does 11 mean 2011 or 1911?
 
Upvote 0

Forum statistics

Threads
1,215,376
Messages
6,124,593
Members
449,174
Latest member
chandan4057

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top