473,511 Members | 14,052 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Find Earliest Date no-brainer

How do you find the earliest of a set of dates in a field using a query? I
thought using "min" in a totals query would work but it seems to treat the
date like text. I feel a forehead slapping moment approaching ...

TIA - Keith.

Sep 18 '08 #1
3 6798
"Keith Wilby" <he**@there.comwrote in message
news:48**********@glkas0286.greenlnk.net...
How do you find the earliest of a set of dates in a field using a query?
I thought using "min" in a totals query would work but it seems to treat
the date like text. I feel a forehead slapping moment approaching ...

TIA - Keith.
Well, if the field/column you are using is formatted as a string and not as
a date, then try changing your "min" expression from:
[fieldname]

to:
cdate([fieldname])

or:
format([fieldname], "mm/dd/yyyy")

Fred Zuckerman
Sep 18 '08 #2
Keith Wilby wrote:
How do you find the earliest of a set of dates in a field using a
query? I thought using "min" in a totals query would work but it seems
to treat the date like text. I feel a forehead slapping moment
approaching ...

TIA - Keith.
What is it showing? The max? Something inbetween? Maybe provide your
SQL...perhaps you have some filter in the query...or if you are using a
subquery perhaps that limits the list as well. IOW, please verify all
"tables" the query links to as inner joins shouldn't be left joins or
that the "tables" are queries that filter records.

Sep 18 '08 #3
"Keith Wilby" <he**@there.comwrote in message
news:48**********@glkas0286.greenlnk.net...

I should add that it's an Oracle table and the data type is "Date".

Sep 18 '08 #4

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

Similar topics

7
1832
by: pwnalwandi | last post by:
hi everyone out there can anyone give me the value of a(wn executed saperatly) initially a=5 a+=(a++)+(++a) a-=(--a)-(a--) support ur answers with reasons (precedence,assoivity) thanks in...
25
4029
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
5
23284
by: sck10 | last post by:
Hello, I am using the code below to set the values of a DetailsView template field using FindControl. My question is how would you find a control if its a Boundfield control? For example,...
17
2989
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). ...
67
7600
by: PC Datasheet | last post by:
Transaction data is given with date ranges: Beginning End 4/1/06 4/4/06 4/7/06 4/11/06 4/14/06 4/17/06 4/18/06 4/21/06 426/06 ...
1
1579
by: colinw | last post by:
I need to query a table of data that has multiple datetime entries in it relating to individual customer records. So one customer could have 1 entry, or it could have 10 entries. I need to be able to...
2
2111
by: TCopple | last post by:
I have a tabled which looks something like Date ID Balance 2007-1-1 1 400000 2006-1-1 1 700000 2005-1-1 ...
8
3276
by: Tetelestai | last post by:
I would like help with the syntax of a query that will return 1 childs' record field that has the earliest date. I assume this could be done in a query. example of tables: tblOrder - Parent...
2
5384
by: parreola | last post by:
MS Access 2000. I'm creating a query where Table 1 has Item Number and Location. Table 2 has Item Number, Date Purchased, and Price. When I run query I get multiple dates purchased. I really want to...
3
4400
by: Lance Wynn | last post by:
Hello, I am receiving this error when trying to instantiate a webservice component. I have 2 development machines, both are XP sp2 with VS 2008 installed. On one machine, the code works fine. On...
0
7144
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
7356
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,...
1
7085
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...
0
7512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5671
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,...
1
5069
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
4741
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
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1577
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.