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

Home Posts Topics Members FAQ

Help with MIN field value

I have table FOO, fields F1, F2, F3, F4, and F5.

I need a single SELECT statement on FOO that returns the LOWEST date
between the five fields.
So, if table records looked like

FOO:
F1 F2 F3 F4 F5
3/25/03 3/12/03 3/10/03 3/15/03 3/22/03
5/03/03 5/10/03 5/22/03 5/22/03 5/03/03
9/10/03 9/09/03 9/12/03 9/01/03 9/15/03

The select statement would return:
3/10/03
5/03/03
9/01/03
Again, this would need to work in a single select statement. If it is
impossible, then if a stored procedure could be used, please show
that.

Thanks!!

Marc
Jul 19 '05 #1
2 2557

Look up LEAST function
"Marc A. Lefebvre US-775" <le******@iwavesolutions.com> wrote in message
news:5e**************************@posting.google.c om...
I have table FOO, fields F1, F2, F3, F4, and F5.

I need a single SELECT statement on FOO that returns the LOWEST date
between the five fields.
So, if table records looked like

FOO:
F1 F2 F3 F4 F5
3/25/03 3/12/03 3/10/03 3/15/03 3/22/03
5/03/03 5/10/03 5/22/03 5/22/03 5/03/03
9/10/03 9/09/03 9/12/03 9/01/03 9/15/03

The select statement would return:
3/10/03
5/03/03
9/01/03
Again, this would need to work in a single select statement. If it is
impossible, then if a stored procedure could be used, please show
that.

Thanks!!

Marc

Jul 19 '05 #2
The select statement would be

select least(f1,f2,f3,f4,f4) from foo;
le******@iwavesolutions.com (Marc A. Lefebvre US-775) wrote in message news:<5e**************************@posting.google. com>...
I have table FOO, fields F1, F2, F3, F4, and F5.

I need a single SELECT statement on FOO that returns the LOWEST date
between the five fields.
So, if table records looked like

FOO:
F1 F2 F3 F4 F5
3/25/03 3/12/03 3/10/03 3/15/03 3/22/03
5/03/03 5/10/03 5/22/03 5/22/03 5/03/03
9/10/03 9/09/03 9/12/03 9/01/03 9/15/03

The select statement would return:
3/10/03
5/03/03
9/01/03
Again, this would need to work in a single select statement. If it is
impossible, then if a stored procedure could be used, please show
that.

Thanks!!

Marc

Jul 19 '05 #3

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

Similar topics

0
by: Preston Landers | last post by:
Hello all. I am trying to write a query that "just" switches some data around so it is shown in a slightly different format. I am already able to do what I want in Oracle 8i, but I am having...
1
by: Philip | last post by:
Hi, I am trying to output certain nodes inside another. I have an xml template with field definitions for a form, and this includes textfields, labels, checkboxes etc plus fieldssets. I defined...
4
by: Adrian Charteris | last post by:
Hi I'm currently trying to use a lookup table for converting one xml doc to another using a XSLT transformation. Ideally I would like my first xml doc to be converted to my second xml doc below. ...
7
by: Mike | last post by:
I've been trying for the past week to put a simple code together. I have done a LOT of searching, found scripts showing the functions I would like to use, however when I mix them it all goes wrong,...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
13
by: Chua Wen Ching | last post by:
Hi there, I saw this article here in vb.net. http://www.error-bank.com/microsoft.public.dotnet.languages.vb.1/148992_Thread.aspx and ...
10
by: 60325 | last post by:
This is the page where I collect the data in drop-down boxes with values of 1-10 and send it to a submitted page to do calculations. Example: Employee1 TeamScore(1-10) Employee2 ...
4
by: Debbiedo | last post by:
My software program outputs an XML Driving Directions file that I need to input into an Access table (although if need be I can import a dbf or xls) so that I can relate one of the fields...
10
by: dkyadav80 | last post by:
<html> /// here what shoud be java script for: ->when script run then not display all input text field only display selection field. ->when user select other value for institute only this...
4
by: mattehz | last post by:
Hey there, I am trying to upload old source files and came across these errors: Warning: Invalid argument supplied for foreach() in /home/mattehz/public_html/acssr/trunk/inc_html.php on line 59...
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
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...
1
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
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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.