473,404 Members | 2,137 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,404 software developers and data experts.

How to Retrieve Records of any other Date IF Current Date Record is not present?

Soniad
66
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 displayed.but there me cases when some day details are not updated.
Hence, I need query where if current date record is not there then it should fetch records of any other date for which record is present.
I could do this by showing previous date record,But not necessary that previous date record is always present.

Any Suggestion.

Regards,
"D"
Jan 27 '11 #1

✓ answered by Rabbit

Instead of matching on current date, you could match on MAX() date.

2 2116
Rabbit
12,516 Expert Mod 8TB
Instead of matching on current date, you could match on MAX() date.
Jan 27 '11 #2
Soniad
66
Hi Rabbit,

Thanx.yes now it worked.By taking the last date in subquery.

Expand|Select|Wrap|Line Numbers
  1. Select * From Tbl Where DtDate = 
  2. (Select  Max(DtDate)  From Tbl)
  3. Order By ColID
Regards,
"D"
Feb 1 '11 #3

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

Similar topics

2
by: lphuong | last post by:
Access 2000 I have a fldCreateDate on frmCustomer(mainform)and also a fldCreateDate on frmCustomerVisit(subform). They are one to many relationship. On the main form, frmCustomer, I have a...
11
by: B-Dog | last post by:
This has to be so simple, I'm trying to build a select query using OLEDB adapter using Jet 4.0 that only selects records with today's date. In access =Date() works great but of course it doesn't...
1
by: Jeroen | last post by:
Hello, Is it possible to retrieve the date when a record is created in an Access database table? And if so, how can I do that (by code)? Thanks in advance, Jeroen Elias
13
by: kev | last post by:
Hi all, I have created a database for equipments. I have a form to register the equipment meaning filling in all the particulars (ID, serial, type, location etc). I have two buttons at the end...
0
by: Shawger Lager | last post by:
Hi, I am new to DB2 (and SQL) and I am having some problems with the current date. I am trying to make sure the date in the table review is not past the current day using a constriant. I have tried...
4
by: mcca0081 | last post by:
hi - i'm trying to delete one of the duplicate records based on the most current date. here's the code for my access 2000 db. any help would be appreciated!!! - thank you kindly Sub...
4
by: Steve Rainbird | last post by:
Is there a way in DB2 I can get the current date and time formatted. In Oracle I could do the following select to_char(sysdate,'yyyymmdd') from dual returns 20070718
7
by: GraemeC | last post by:
I have a form (single record form) that loads records from a query that are sorted date order as the records are viewed in date order. Some dates are in the past and some are in the future. Currently...
3
by: lyndac | last post by:
Hello! Last night a job to create a view using DATE(CURRENT DATE - 1 DAY) received the current days date instead the previous days date. Any one know why/how this can happen? The...
4
by: Evanescent | last post by:
Hi Guys, I am trying to create a form which allows the users to retrieve records based on the values entered or chosen in the various combo boxes and textboxes, such as the customer's name, invoice...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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
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...

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.