473,383 Members | 1,885 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,383 software developers and data experts.

How to automatically update last day of month before the newmonth

i have invdate, nextdate(being the date after),days,
01/05/2016 03/05/2016 2days
03/05/2016 15/05/2016 12days
15/05/2016 26/05/2016 10 days
26/05/2016 i want to automaticall update here with 31/05/2016
02/06/2016

SELECT
Rental.OrderID, Rental.AccNo, Rental.Customer, Rental.InvDate, Rental.Invoice, Rental.QtyDel, Rental.QtyRet,
Sum(DSum("[QtyDel]-[QtyRet]","[Rental]","[Rental].[OrderID]=" & [Rental].[OrderID] & " AND [Rental].[OrderID]<=" & [Rental].[OrderID])) AS RT,
AllDays.InvDate,
Sum(DSum("[QtyDel]-[QtyRet]","[Rental]","[Rental].[OrderID]=" & [Rental].[OrderID] & " AND [Rental].[OrderID]<=" & [Rental].[OrderID])) AS DT,
AllDays.NextDate,
DateDiff("d",[AllDays].[InvDate],[NextDate]) AS Days
FROM
(SELECT
OrderID, AccNo, InvDate,
Nz((SELECT MIN(InvDate)
FROM Rental T2
WHERE T1.accno = T2.accno And T2.InvDate > T1.InvDate), DateSerial(Year(T1.InvDate), Month(T1.InvDate) + 1, 0)) AS NextDate

FROM
Rental AS T1) AS AllDays
INNER JOIN
Rental ON AllDays.OrderID=Rental.OrderID
GROUP BY
Rental.OrderID, Rental.AccNo, Rental.Customer, Rental.InvDate, Rental.Invoice, Rental.QtyDel, Rental.QtyRet,
AllDays.InvDate, AllDays.NextDate;
Jun 9 '16 #1
0 5625

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

Similar topics

0
by: Kate | last post by:
Hi... I have a foxpro program which is for producing excel reports back ended to foxpro table(.dbf). Since the table is getting bigger and bigger, it slows down my program. I need a program...
4
by: Terry | last post by:
Hello, I am designing a form from scratch and need to know how to get a Check Box(PASS)to automatically update when the data in a Text Box (MARK), in the same form, is >=24. Using the Event...
0
by: Rose | last post by:
I have a database table with fields Proficiency Due Date and Proficiency Recvd Date. The Proficiency Due Date is already populated. When I enter the Prof Recvd Date, I want to automatically add...
1
by: Jimmy | last post by:
I have a table that is shown below in ORIGINAL TABLE. It is common for the VEHICLE # field to have repeating vehicles (ID 3,4,5 & 8,9). Usually the Vehicle will have SHIPDATE, DATE_RECEIVED, and...
2
by: Vijay Balki | last post by:
I need to view a discussion posted last month in this group. How do I see it? VJ
6
by: John | last post by:
I have a multi-user Access database with back- and front end on the network. Problem is that the forms don't get refreshed automatically: if user A enters a record it will only become available to...
1
by: Mufasa | last post by:
So I have a calendar control - and I have it automatically select last week. So this week it selected 8/24/2008 and 8/30/2008 which is what I want. Problem is - it's showing September. How can I...
2
by: Peter | last post by:
Is there a way to automatically update a Windows .NET service, kind of like Click-Once or put a file in the directory and the service would restart it's self and replace the executables or at least...
3
by: Coolboy55 | last post by:
Hi everyone, I'm having some trouble with a query. I have a history table where one of the fields is a date stamp. My query takes a date from the user, and I want the query to return all records...
7
by: jpmatthews | last post by:
I need VB code that will automatically pull last month's current data and place it in this month's previous data. We have a form that we use to document meter readings. So for example, when we...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.