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

Finding nearest date compared to other date

65
Hi,

I've got this query returning Longfunction and Parameters for some patients.
I select all longfunctions and when there is a matching date the parameter is displayed. But now I would like to display the parameter when I have no matching date, I'd like to see the parameter wich is taken before or after the date, depending on the time between them.

Expand|Select|Wrap|Line Numbers
  1. SELECT Patient.eadnr, Patient.Naam, Patient.Voornaam, longfunctie.Datum, longfunctie.FVC, longfunctie.FEV1, longfunctie.[MEF 50%], PatParameters.Parameter, PatParameters.Waarde
  2. FROM Patient, longfunctie, PatParameters
  3. WHERE (((Patient.eadnr)=[Longfunctie].[eadnr] And (Patient.eadnr)=[PatParameters].[eadnr] And (Patient.eadnr)=[forms]![patchoise]![eadnr]) AND ((longfunctie.Datum)=[PatParameters].[Datum]));

Greetz
Twanne
Aug 3 '07 #1
1 1881
Rabbit
12,516 Expert Mod 8TB
Hi,

I've got this query returning Longfunction and Parameters for some patients.
I select all longfunctions and when there is a matching date the parameter is displayed. But now I would like to display the parameter when I have no matching date, I'd like to see the parameter wich is taken before or after the date, depending on the time between them.

Expand|Select|Wrap|Line Numbers
  1. SELECT Patient.eadnr, Patient.Naam, Patient.Voornaam, longfunctie.Datum, longfunctie.FVC, longfunctie.FEV1, longfunctie.[MEF 50%], PatParameters.Parameter, PatParameters.Waarde
  2. FROM Patient, longfunctie, PatParameters
  3. WHERE (((Patient.eadnr)=[Longfunctie].[eadnr] And (Patient.eadnr)=[PatParameters].[eadnr] And (Patient.eadnr)=[forms]![patchoise]![eadnr]) AND ((longfunctie.Datum)=[PatParameters].[Datum]));

Greetz
Twanne
I don't follow. Can you explain again and provide an example? And why are you not using joins instead?
Aug 3 '07 #2

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

Similar topics

2
by: Scott Knapp | last post by:
Good Day - I have a form which sets the current date, as follows: <script type="text/javascript"> xx=new Date() dd=xx.getDate() mm=xx.getMonth()+1 yy=xx.getYear() mmddyy=mm+"/"+dd+"/"+yy...
8
by: Dennis M. Marks | last post by:
What is the maximum valid date range for the date(yyyy,mm,dd) function. -- Dennis M. Marks http://www.dcs-chico.com/~denmarks/ Replace domain.invalid with dcsi.net -----= Posted via...
4
by: Matteo | last post by:
Hy everybody. I'm not a html writer, but a sysadmin who's trying to help a user able to compile an online form with IE but not with Mozilla (Moz1.6, Ns7.1, Firefox 0.8+) due to a javascript date...
2
by: AdityaK | last post by:
Is there anyway I can get weekend date for a given date using DB2 query? I couldn't find any DB2 function that can be used to do so. Thanks, Aditya
3
by: Matt | last post by:
Given a date, how to find the beginning date and ending date of that week please advise!
1
by: abcabcabc | last post by:
I write an application which can let user define own date format to input, How to convert the date string to date value with end-user defined date format? Example, User Defined Date Format as...
2
by: rdraider | last post by:
Hi, We have a lame app that uses 2 datetime(8) fields, 1 stores the date, the other the time. example query: select aud_dt, aud_tm from orders results: aud_dt ...
0
by: coolvivek33 | last post by:
hi i am facing a strange problem i am trying to build report using sql server 2005 and microsoft visual studio2005 now it is in requirement that i should seperate date from time.I have done that...
2
Soniad
by: Soniad | last post by:
Hi, In my website, I show commodity details on daily basis.These details are stored in one table for each day. I select record by matching current date and current date records are...
1
by: Sheldon Rayner | last post by:
Okay, I'm new to this access stuff, so please bear with me. I want to different dates for each client as I enter the info. A referral date and an interview date. But when I try to do this with two...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.