Ask a Question related to ASP Database, Design and Development.
-
HallMonitor89 #1
Getting first record of the day
I need help getting the right SQL statement . I would like to grab the
first record of the day (records have a date entry and a time entry
associated with them.
I know it is going to be a select statement, but the right syntax eludes
me (these late nights and early mornings makes the brain a little
foggy).
Any help would be appreciated.
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
HallMonitor89 Guest
-
How can i retrieve record ONLY From 300 - 400 in amillion Record Table?
HI all Thanks for your time.. I have a question here.. How can i retrieve record ONLY From XXX - XXX in a million Record Table? eg. I have a... -
Find record w/ conditions met in the same child record
I'll use 2 files to demonstrate my question. The first file is Animal. It has 4 fields. Id (serial number) ZooId (number) Name (text) Food... -
using dropdown box to display db record & update record
Hi Folks, I have a web database written in asp and using access97. I have many projects, but each project is being held responsible by a person.... -
Stop adding record in subform after record count = 1
Can someone help in in what to put after the THEN statment to allow one entry if the Record count is =>1 in the Before insert or should I set the... -
Adding a new record when the record source is a query.
Hello All, I have a form that runs a query. The reason it runs on a query is because prior to it opening I have a form from which you can pick... -
Ray at #2
Re: Getting first record of the day
What kind of database?
Ray at work
"HallMonitor89" <nospam@novirus.com> wrote in message
news:O241UANwDHA.2472@TK2MSFTNGP09.phx.gbl...>
>
> I need help getting the right SQL statement . I would like to grab the
> first record of the day (records have a date entry and a time entry
> associated with them.
>
> I know it is going to be a select statement, but the right syntax eludes
> me (these late nights and early mornings makes the brain a little
> foggy).
>
> Any help would be appreciated.
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Ray at Guest
-
Turkbear #3
Re: Getting first record of the day
On Fri, 12 Dec 2003 12:54:08 -0500, "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote:
In general:>What kind of database?
>
>Ray at work
>
>"HallMonitor89" <nospam@novirus.com> wrote in message
>news:O241UANwDHA.2472@TK2MSFTNGP09.phx.gbl...>>>
>>
>> I need help getting the right SQL statement . I would like to grab the
>> first record of the day (records have a date entry and a time entry
>> associated with them.
>>
>> I know it is going to be a select statement, but the right syntax eludes
>> me (these late nights and early mornings makes the brain a little
>> foggy).
>>
>> Any help would be appreciated.
>>
>>
>> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
>> Don't just participate in USENET...get rewarded for it!
( Sql varies between databases, so this will work on Oracle - altho it may be different for some versions-, for
instance, but may not work in Access or SqlServer )
select * from table where date_entry = sysdate and time_entry = (select min(time_entry) from table where date_entry =
sysdate);
The idea is to get today's records and then test for the earliest time..
hth,
Turkbear Guest
-
HallMonitor89 #4
Re: Getting first record of the day
Database is Access 2k. Contains 1 table. Very Simple Database.
Columns are CustName, Date, Time, OrderID
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
HallMonitor89 Guest
-
Ray at #5
Re: Getting first record of the day
You have separate columns for date and time? Hmm. In that case:
SELECT TOP 1 [CustName],[Date],[Time],[OrderID] FROM Table1 WHERE
[Date]=Date() ORDER BY [Time]
If you had just one column that had date and time,
SELECT TOP 1 Custname,EntryTime,OrderID FROM Table1 WHERE
DateDiff('d',EntryTime,Date()) = 0 ORDER BY EntryTime
Ray at work
"HallMonitor89" <nospam@novirus.com> wrote in message
news:uSp%23M4NwDHA.3416@tk2msftngp13.phx.gbl...>
>
> Database is Access 2k. Contains 1 table. Very Simple Database.
> Columns are CustName, Date, Time, OrderID
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Ray at Guest
-
HallMonitor89 #6
Re: Getting first record of the day
That works, thanks.
I know it would be more ideal to have the date and time in the same
column (it sure would help with other programming aspects).
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
HallMonitor89 Guest
-
Ray at #7
Re: Getting first record of the day
"HallMonitor89" <nospam@novirus.com> wrote in message
news:uppDnZOwDHA.1744@TK2MSFTNGP12.phx.gbl...
There's plusses and minuses to both ways, I'd say. This is something you> I know it would be more ideal to have the date and time in the same
> column (it sure would help with other programming aspects).
>
should be more aware of though:
[url]http://www.aspfaq.com/show.asp?id=2080[/url]
Ray at work
Ray at Guest
-
Aaron Bertrand [MVP] #8
Re: Getting first record of the day
> I know it would be more ideal to have the date and time in the same
And in some databases, you don't have much choice.> column
[url]http://www.aspfaq.com/2206[/url]
So why not add a column with the combined information?> (it sure would help with other programming aspects).
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Aaron Bertrand [MVP] Guest



Reply With Quote

