473,398 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Query refuses big slice of date differences

Jerry Maiapu
259 100+
I have this parameter query that collect its parameter from a Form text box (Start date and Endate)

When a small datediff is specified (eg. from 02/02/2010 to 10/02/2010)the query runs but when a bigger date diff is specified, it refuses to run (eg. 02/02/2010 to 03/03/2010). What is the main cause.

Facts; No null values
Query involves date/time calculations with some aggregate functions:
Error message" This expression is typed incorrectly, or is too complex to be evaluated..."

Because the error is generated within the query the parameter form freezes leaving behind only option is to close using TASK MANGER.
Have someone come around such scenerio? Help needed

Ta..
Oct 18 '10 #1
4 1127
jimatqsi
1,271 Expert 1GB
It might be helpful for you to past the SQL code from the query here for us to see. You can get that by going into SQL view mode from the query editor.

Note that in your example, what you are calling a bigger datediff is actually a smaller date range than the "small datediff." Probably just a typo on your part.

Jim
Oct 18 '10 #2
Jerry Maiapu
259 100+
jimatqsi, actually my dates were in the format dd-mm-yy so I think I was right anyway. my query is quite long so I decided not post post it as it might scare people off but since you ask I'll do so.

Here is the SQL:
Expand|Select|Wrap|Line Numbers
  1. SELECT [Summary 2weeks].Salutation, 
  2. [Summary 2weeks].[Full Name],
  3.  [Summary 2weeks].[Days Worked], 
  4. IIf((WorkingDays([Forms]![Parameter Collector]![Oyear],
  5. [Forms]![Parameter Collector]![Ndate]))-([Days Worked])<0,0,
  6. (WorkingDays([Forms]![Parameter Collector]![Oyear],
  7. [Forms]![Parameter Collector]![Ndate]))-([Days Worked])+1) AS [Days Absent], 
  8. IIf(IsNull([Overtime Summary.CountOfDateWorked]),0,
  9. [Overtime Summary.CountOfDateWorked]) AS [Overtime Days],
  10.  [Summary 2weeks].SumOfHrtMintNoAOT,
  11.  [Summary 2weeks].SumOfHrtMintAOT,
  12.  IIf(IsNull([Overtime Summary].[Sum Of Hours]),0,
  13. [Overtime Summary].[Sum Of Hours]) AS [Overtime Hrs], 
  14. IIf(IsNull([Overtime Summary].[Sum Of Minutes]),0,
  15. [Overtime Summary].[Sum Of Minutes]) AS [Overtime Mins],
  16. Credits_All_Total.SumOfFinalResetedCredit, 
  17. FirstnLAstEmployess.AbsentCredit, 
  18. [SumOfFinalResetedCredit]-[AbsentCredit] AS OverallCredit
  19. FROM FirstnLAstEmployess INNER JOIN ([Overtime Summary]
  20.  RIGHT JOIN (Credits_All_Total INNER JOIN [Summary 2weeks] ON
  21.  Credits_All_Total.EmployeeID = [Summary 2weeks].EmployeeID) ON 
  22. [Overtime Summary].EmployeeID = Credits_All_Total.EmployeeID) ON
  23.  FirstnLAstEmployess.Employees_EmployeeID = Credits_All_Total.EmployeeID
  24. ORDER BY [Summary 2weeks].[Full Name];
More Infor:

The joins are not based on tables but on Query: The parameter query is called Alltwoweek. ok Summary 2weeks above (bolded in lines 123)is a summary query based on Alltwweek query:

So in actuall fact the parameter query is participating indirectly with the posted query above.

Summary 2weeks and Alltwoweek when run is ok but the above query poses the problem with long date ranges like I mentioned.


Thanks so much.

For clearity I will edit my db containing the SQl and post it within the next 30 to 40 minutes time.
Oct 18 '10 #3
jimatqsi
1,271 Expert 1GB
Yes, maybe posting the db will be necessary.

One of the things I do in such a case is to copy my query and delete columns from my query, one by one, until the error goes away. But since your program is locking up, maybe I would add the columns one by one until the error occurs. Then I would at least know what column is causing the error to occur.

Jim
Oct 19 '10 #4
Jerry Maiapu
259 100+
jimatqsi , thanks maybe I should try that first.
Oct 19 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Cady Steldyn | last post by:
Example: Date | ItemCode | Stock_In_qty | Stock_Out_qty | Bal_qty ------------------------------------------------------------------ 12/09/2003 | A100 | 20 | 0 ...
1
by: Pooja Raisingani via AccessMonster.com | last post by:
Hello, Can anyone please tell me How to use a select query to extract date from a Datetime field in Access 2000?? Thanks -- Message posted via http://www.accessmonster.com
3
by: bcaponet | last post by:
I have a form where a user enters a date that I will then base a query on. In the past, I have simply placed Forms!! into the criteria for a query and it runs as long as the form is open. The...
1
by: pauly | last post by:
Hello All, I have been trying to create a query that extracts data from a table and calculates the elapsed time between records. The table called "Imported_table". I need to be able to calculate...
3
by: seegoon | last post by:
Hi to all. I have a small problem I hope someone can help me with. I am running a sql query to a csv file. The query searches for the total of a column between 2 dates. This is a copy of one of...
1
by: b.beeching | last post by:
Not sure if my subject is entirely accurate but here goes. I need to calculate the date difference between a date A and a date B... however date B relies entily on date A. EG: i have an advert...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
17
by: MrChris | last post by:
I'm trying to figure out how to get a query to work by picking up a date in between 2 date entries. this is (kind of) how the database works: User put in the 'Start Date' and 'End Date' for...
2
by: jennwilson | last post by:
I am trying to generate a report based on a query that will list any records where an individual has a date listed that matches the specified time for one or both of the date fields. The two fields...
7
by: colintis | last post by:
I'm fixing a query that takes date filter on specific date (e.g. 10/13/2010). The date field in the table source also contains time along with the date. (E.g. 13/10/2010 6:26:45 AM) On the where...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.