473,466 Members | 1,397 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Date conditions

7 of 9
23 New Member
Hello All,

Here is my problem I have i set of queries (4) that I run manualy every morning to check all transactions from the previous day. I am in the process of creating the macro to run them automatically every morning but i have run into a slight problem. My first query is

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT cono, whse, prod, module, transtype, stkqtyship, phyadjexcp, operinit, postdt, transtm 
  3.  
  4. FROM tblLcet
  5.  
  6. WHERE  ((tblLcet.postdt)>=Now()-1);
  7.  
  8.  
but what do i do when on monday when Now()-1 returns nothing because we are closed on sunday?
May 23 '08 #1
4 1962
nico5038
3,080 Recognized Expert Specialist
Hello All,

Here is my problem I have i set of queries (4) that I run manualy every morning to check all transactions from the previous day. I am in the process of creating the macro to run them automatically every morning but i have run into a slight problem. My first query is

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT cono, whse, prod, module, transtype, stkqtyship, phyadjexcp, operinit, postdt, transtm 
  3.  
  4. FROM tblLcet
  5.  
  6. WHERE  ((tblLcet.postdt)>=Now()-1);
  7.  
  8.  
but what do i do when on monday when Now()-1 returns nothing because we are closed on sunday?
And not to mention the holidays like X-mas, etc...
Probably you want always the last date holding the transactions of the previous business day.
I would just select the MAX() tblLcet.postdt being not today like:

WHERE tblLcet.postdt = (select max(B.postdt) from tblLcet B WHERE B.postdt < Date())

Getting the idea ?

Nic;o)
May 23 '08 #2
7 of 9
23 New Member
And not to mention the holidays like X-mas, etc...
Probably you want always the last date holding the transactions of the previous business day.
I would just select the MAX() tblLcet.postdt being not today like:

WHERE tblLcet.postdt = (select max(B.postdt) from tblLcet B WHERE B.postdt < Date())

Getting the idea ?

Nic;o)
Thanks Nico I tried it and it works but what if someone comes in on saturday to catch up with his/ her work? The report (That runs mon - friday) would never show the transactions from friday. How would resolve this?
May 23 '08 #3
nico5038
3,080 Recognized Expert Specialist
Just schedule the job every day (use the windows scheduler) and save the file with the Date() in the name. The size will tell you or something has been found and the dates or all jobs did run.

Nic;o)
May 23 '08 #4
7 of 9
23 New Member
Just schedule the job every day (use the windows scheduler) and save the file with the Date() in the name. The size will tell you or something has been found and the dates or all jobs did run.

Nic;o)

Thanks again ill give it a try this weekend.
May 23 '08 #5

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

Similar topics

5
by: Gord | last post by:
Many scripts and calendars call client side system time in order to make presentations. However, the client's time may be improperly set, if set at all, and/or the relevant time may be from...
20
by: rhino | last post by:
This worked before October now it does not work. I think I know where the trouble is but I don't know how to fix it. function findVerse() { var d = new Date(); var str; if( (...
1
by: DL | last post by:
Hi, I have a table with quite a few fields wich saves al kind of activities on has done on one day. Most important to identify a unique record is the date and personID. A person is only allowed...
12
by: Steve Elliott | last post by:
I have a query set up to gather together data between two specified dates. Shown in the query column as: Between #24/09/2004# And #01/10/2004# Is it possible to enter several different date...
1
by: kevcar40 | last post by:
Hi i have a table that contains a number of fields task : text create date : short date revision date :short date every 90 days i need to review the record(make sure conditions still apply)...
3
by: menglin.cao | last post by:
Hi, I am trying to join two tables, one has multiple records per ID, the other is unique record per ID. The two tables look like below A ID date var1 var 2 001 1/1 10 20 001 2/1 ...
10
by: Henrik Dahl | last post by:
Hello! I have an xml schema which has a date typed attribute. I have used xsd.exe to create a class library for XmlSerializer. The result of XmlSerializer.Serialize(...) should be passed as the...
20
by: keri | last post by:
Hi, I am creating a table where I want to use the date as the primary key - and to automatically create a record for each working date (eg Mon to Fri) until 30 June 2007. Is this possible? I do...
3
by: abctech | last post by:
I have an Html page, user enters a Date (dd-mm-yyyy) here. There's a servlet connected in the backend for processing this submitted information, it must have a method to compare this entered date...
8
beacon
by: beacon | last post by:
Hi everybody, I'm having a terrible time trying to accomplish what I thought would be extremely easy. I have three date fields on a form (DischargeDate, ReceivedDate, and AuditedDate) and I'm...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.