473,799 Members | 3,052 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MAX(DATE) - help

Hello everyone:

i am trying to compare a MAX(DATE) from one table that would be greater
than a date in another.

first_table

compname MYDATE

abc comp 2006-09-26 09:19:43.250
123inc 2006-10-20 01:3:00.250

SELECT MAX(MYDATE) FROM first_table

log_table

logdate

2006-01-15 05:12:41.250

I would like to get the MAX(MYDATE) which is greater than the logdate.
thx

f.

Nov 2 '06 #1
1 2230
Freddie ,
If I understand correctly ,

What you want all the dates in log_table having date less than
max(date) in first table

SELECT * FROM log_table WHERE log_date < (SELECT MAX(DATE) FROM
first_table)

M A Srinivas
Freddie wrote:
Hello everyone:

i am trying to compare a MAX(DATE) from one table that would be greater
than a date in another.

first_table

compname MYDATE

abc comp 2006-09-26 09:19:43.250
123inc 2006-10-20 01:3:00.250

SELECT MAX(MYDATE) FROM first_table

log_table

logdate

2006-01-15 05:12:41.250

I would like to get the MAX(MYDATE) which is greater than the logdate.
thx

f.
Nov 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2977
by: NBaker | last post by:
I have 1 table 'Data' and i need to select the max date. The table contains multiple rows per URN so I need all the fields where the date is most recent. URN £ Date Gift Type Frequency 164287 £5.00 19/05/1988 Recurring Gift Monthly 164287 £5.00 02/10/1992 Recurring Gift Monthly 164287 £4.00 01/04/2001 Recurring Gift Monthly Therefore i only need 164287 where the date is highest at 01/04/2001. i have...
1
2449
by: 400NEWBIE | last post by:
Hi everyone, I'm having trouble figuring out how to select the max date in MS ACCESS from an AS400 table with a composite key. Here's my data: Type Name Select-Rule Error-Rule Effec-Date Effec-Time Sev-Lvl X AMTFIN "" AF>8K 11/1/2005 110000 0 X AMTFIN "" AF>8K 5/17/2005 110000 2 The composite key for the table is:
9
4504
by: robtyketto | last post by:
Is there anyway to change the max date to datenow + 2 years I tried this in the properties -> Format -> MaxDate = dateadd("yyyy",2,date()) without success :( Can anyone help. Thanks, a big thank you to all those who've helped me previously too :)
1
3719
by: Matik | last post by:
Hello Everybody, I have a problem, with select stmt: SELECT TOP 15 * FROM oaVIEW_MainData AS TOP_VIEW, oaLanguageData_TAB AS RwQualifierJoin with (nolock) WHERE (c_dateTime>='2007.01.10 00:00:00' AND c_dateTime<='2007.01.10 23:59:59') AND RwQualifierJoin.text_id = c_cfgRegPoint
1
2319
by: Anne150585 | last post by:
Hi, I was wandering if anyone could give me some help... The idea is that I want to create a stored procedure that will check a bunch of tables and give me the latest 'LastUpdated' field Something like:- Select Max(LastUpdated) from Table1 = @date1 Add Date1 to tempTable
1
1774
by: abetancur | last post by:
I have the following code: SELECT MAX(INVENTORY_TRANSACTION_HIST.DATE_APPLIED) AS LAST_TRANS, INVENTORY_TRANSACTION_HIST.PART_NO FROM INVENTORY_TRANSACTION_HIST INNER JOIN INVENTORY_PART_IN_STOCK ON INVENTORY_TRANSACTION_HIST.PART_NO = INVENTORY_PART_IN_STOCK.PART_NO WHERE (INVENTORY_TRANSACTION_HIST.TRANSACTION_CODE IN ('PICK-IN', 'PICK-OUT', 'NREC', 'ARRIVAL')) AND ...
3
2784
Inbaraj
by: Inbaraj | last post by:
Hi... I have a Table in that i have inserted the DATE as VARCHAR now in that i Want to get the Max Date. I am new to MySQL Plz help me how to find the max date. with regard Inbaraj.D
5
3610
by: sbettadpur | last post by:
hello Let me explain first the table structure. table - > pds fields - >District_ID, W_ID, Commodity_ID, Distribution_Cat_ID, Date, OB, Closing_Stock here i want the Closing_Stock value of particular District_ID and Commodity_ID and Distribution_Cat_ID and for particular month where Date=MAX(date)
10
6619
by: janieavis | last post by:
If I run this query I can see there are 2 records with the dates 10 August 2009 and 24 August 2009: SELECT dbo_JobMain.BpaMainPKey, dbo_JobMain.JobDefinitionPKey, dbo_JobMain.Value, dbo_JobMain.VisitDate FROM dbo_JobMain WHERE (((dbo_JobMain.BpaMainPKey)="000000000040abeb") AND ((dbo_JobMain.JobDefinitionPKey)="001000000043pobf") AND ((dbo_JobMain.VisitDate) Between #8/1/2009# And #8/31/2009#)) ORDER BY dbo_JobMain.JobDefinitionPKey; But...
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10251
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10225
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9072
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7564
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
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 we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.