Hi, I have looked arouind and cannot find a way to query my database by date for the last 50 added results only.
I found this which I suppose might be something similar but I need only the most recent 50 added. That might be the last 10 days or 20 depending how many i add per day. - strSQL = "SELECT * from myTable WHERE [surgeryDate] LIKE ' " & fromDate & " ' "
-
the querys I have for all results are like this
-
lngCategoryID=CLng(Request("CategoryID"))
-
If lngCategoryID <> "" And lngCategoryID <> 0 Then
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
SQLQuery="Select PostCardID,DefaultHeadline,CardDescription,DefaultMessage,extratwo,extrathree,Author,AuthorTwo,NewImageOne,NewImageTwo,NewImageThree,NewImageFour,NewImageFive,NewImageSix,NewImageSeven,NewImageEight,ThumbnailURL,AdvancedCard,BackgroundImageURL,ThumbnailHTML From tblGreetingPostCards Where CategoryID=" & Clng(lngCategoryID) & " Order By BackgroundImageURL DESC"
-
rsCard.Open SQLQuery, connPostCardSoft
-
rsCard.PageSize = 1000
-
intPageCount = rsCard.PageCount
-
-
If rsCard.EOF=True Then
-
Response.Write "<p>No artists found in database for this category."
-
Response.End
-
End If
-
End If
If anyone can help that would be great.
Thanks
Richard
2 1295
Hi Richard,
There's an article on Wikipedia on the SELECT function in SQL, which describes the standard (and non-standard) ways of limiting the number of rows returned from a query (depending on your database engine).
It doesn't go into huge detail on the other parts of a SELECT query but contains all the information you need for your particular requirement.
The link is http://en.wikipedia.org/wiki/Select_(SQL).
Hope this helps.
Best regards,
medicineworker
Dear Medicineman,
Thanks for that really useful link.
Richard
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Willem |
last post by:
Hi there,
I'm sort of new with doing much record manipulation with queries. Up
till now I've been programming VBA and doing record looping to get my
results. This works fine but tends to get...
|
by: Georges Heinesch |
last post by:
Hi.
I thought this query would be trivial. After numerous attempts w/o
success, I start to doubt ...
The follwoing table:
Date From To
01.01.2005 SFO BOS
01.01.2005 SFO MIA
|
by: solar |
last post by:
I have a problem with building a totals query showing data
for the last date only.Under the last date i understand the last date
of field invoicedate.This invoice date is in the table orders....
|
by: serge |
last post by:
How can I run a single SP by asking multiple sales question either
by using the logical operator AND for all the questions; or using
the logical operator OR for all the questions. So it's always...
|
by: clare at snyder.on.ca |
last post by:
I have a SQL query I need to design to select name and email addresses
for policies that are due and not renewed in a given time period. The
problem is, the database keeps the information for every...
|
by: Daniel |
last post by:
In Microsoft Access I can write a query that includes the criteria:
Between Date()-7 And Date()
to retrieve the records from a table that fall within the last week.
I'm trying to write a...
|
by: bruce24444 |
last post by:
First of all I'm new to the forum and am working on my first database. So far I think I've done not too bad but have hit a stumbling block for which I'm not sure how to get around.
What I have is...
|
by: kdubble |
last post by:
Hi
I am trying to get the results of a query to show only unique student
records (not duplicates). Is there a simple way to make the criteria
field do this? I am not too familiar with SQL.
...
|
by: bruce.dodds |
last post by:
Access seems to be handling a date string conversion inconsistently in
an append query.
The query converts a YYYYMM string into a date, using the following
function:
CDate(Right(,2) & "/1/" &...
|
by: wevans |
last post by:
I have 3 tables, Customer, Offsite Service and service. I need to create a sales report/query based on the results of the user input, which is a date range. I've got it working great with two of the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
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,...
|
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...
|
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: 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,...
| |