Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old May 17th, 2007, 02:25 PM
Trev
Guest
 
Posts: n/a
Default can a table be opened in access by todays date

Hi
Can anyone point me in the right direction here, I would like to open
a table in access 2003 by date. I have an asp web page which needs to
read data from a table with each days today's date (which ever day
that is) then a new table is created with today's date.

Example:
I have a table called 17-may-2007 my ASP page reads this table for
24hours then tomorrow (12:00 midnight 18th) I will have a new table
called 18-may-2007 and the old table is left behind (As 17-may-2007)
so I need my sql statement to automatically open table by today's
date.


This is what I have so far but it does not work. Any ideas

'---------------Start of code---------------
Call BarGraphSQLData( _
"SELECT id, DataReading FROM DAY(CURRENT_TIMESTAMP) ORDER BY id" ,
_
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("db/data.mdb") & ";" , _

'---------------End of code---------------


Thanks


Trevor

  #2  
Old May 17th, 2007, 03:05 PM
Tom van Stiphout
Guest
 
Posts: n/a
Default Re: can a table be opened in access by todays date

On 17 May 2007 06:21:36 -0700, Trev <trevor-dustan@lycos.co.ukwrote:

Horrible database designs lead to horrible sql statements.
Why not have a single table, with an additional TransactionDate
column?

-Tom.

Quote:
>Hi
>Can anyone point me in the right direction here, I would like to open
>a table in access 2003 by date. I have an asp web page which needs to
>read data from a table with each days today's date (which ever day
>that is) then a new table is created with today's date.
>
>Example:
>I have a table called 17-may-2007 my ASP page reads this table for
>24hours then tomorrow (12:00 midnight 18th) I will have a new table
>called 18-may-2007 and the old table is left behind (As 17-may-2007)
>so I need my sql statement to automatically open table by today's
>date.
>
>
>This is what I have so far but it does not work. Any ideas
>
>'---------------Start of code---------------
>Call BarGraphSQLData( _
"SELECT id, DataReading FROM DAY(CURRENT_TIMESTAMP) ORDER BY id" ,
>_
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
>Server.MapPath("db/data.mdb") & ";" , _
>
>'---------------End of code---------------
>
>
>Thanks
>
>
>Trevor
  #3  
Old May 17th, 2007, 06:05 PM
DavidB
Guest
 
Posts: n/a
Default Re: can a table be opened in access by todays date

On May 17, 9:21 am, Trev <trevor-dus...@lycos.co.ukwrote:
Quote:
Hi
Can anyone point me in the right direction here, I would like to open
a table in access 2003 by date. I have an asp web page which needs to
read data from a table with each days today's date (which ever day
that is) then a new table is created with today's date.
>
Example:
I have a table called 17-may-2007 my ASP page reads this table for
24hours then tomorrow (12:00 midnight 18th) I will have a new table
called 18-may-2007 and the old table is left behind (As 17-may-2007)
so I need my sql statement to automatically open table by today's
date.
>
This is what I have so far but it does not work. Any ideas
>
'---------------Start of code---------------
Call BarGraphSQLData( _
"SELECT id, DataReading FROM DAY(CURRENT_TIMESTAMP) ORDER BY id" ,
_
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("db/data.mdb") & ";" , _
>
'---------------End of code---------------
>
Thanks
>
Trevor
Whats the point of having a different table name each day?

  #4  
Old May 17th, 2007, 07:15 PM
salad
Guest
 
Posts: n/a
Default Re: can a table be opened in access by todays date

Trev wrote:
Quote:
Hi
Can anyone point me in the right direction here, I would like to open
a table in access 2003 by date. I have an asp web page which needs to
read data from a table with each days today's date (which ever day
that is) then a new table is created with today's date.
>
Example:
I have a table called 17-may-2007 my ASP page reads this table for
24hours then tomorrow (12:00 midnight 18th) I will have a new table
called 18-may-2007 and the old table is left behind (As 17-may-2007)
so I need my sql statement to automatically open table by today's
date.
What is "today"? Since this is ASP, you might get hits from anywhere in
the world. So is "today" the same day as the surfer or is today the
network date where the file is stored?

You are opening a can of worms that will bite you in the butt later on.
Quote:
>
>
This is what I have so far but it does not work. Any ideas
>
'---------------Start of code---------------
Call BarGraphSQLData( _
"SELECT id, DataReading FROM DAY(CURRENT_TIMESTAMP) ORDER BY id" ,
_
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("db/data.mdb") & ";" , _
>
'---------------End of code---------------
>
>
Thanks
>
>
Trevor
>
  #5  
Old May 17th, 2007, 09:35 PM
Trev
Guest
 
Posts: n/a
Default Re: can a table be opened in access by todays date

On 17 May, 19:05, salad <o...@vinegar.comwrote:
Quote:
Trev wrote:
Quote:
Hi
Can anyone point me in the right direction here, I would like to open
a table in access 2003 by date. I have an asp web page which needs to
read data from a table with each days today's date (which ever day
that is) then a new table is created with today's date.
>
Quote:
Example:
I have a table called 17-may-2007 my ASP page reads this table for
24hours then tomorrow (12:00 midnight 18th) I will have a new table
called 18-may-2007 and the old table is left behind (As 17-may-2007)
so I need my sql statement to automatically open table by today's
date.
>
What is "today"? Since this is ASP, you might get hits from anywhere in
the world. So is "today" the same day as the surfer or is today the
network date where the file is stored?
>
You are opening a can of worms that will bite you in the butt later on.
>
>
>
>
>
Quote:
This is what I have so far but it does not work. Any ideas
>
Quote:
'---------------Start of code---------------
Call BarGraphSQLData( _
"SELECT id, DataReading FROM DAY(CURRENT_TIMESTAMP) ORDER BY id" ,
_
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("db/data.mdb") & ";" , _
>
Quote:
'---------------End of code---------------
>
Quote:
Thanks
>
Quote:
Trevor- Hide quoted text -
>
- Show quoted text -
Thats why i'm not a programmer or a db designer LOL, ok i get the hit
- what about this option......

todays ping stats which is when i posted this stuff, would be saved in
the
table as 17-may-2007 then tomorrows ping stats would be saved in the
same
table as 18-may-2007 and so on, then on each asp page would select
that days date i guess i would use a stament

Something like:

"SELECT today=now(), DataReading FROM tbldata ORDER BY id" , _

or

"SELECT DAY(CURRENT_TIMESTAMP), DataReading FROM tbldata ORDER BYid" ,
_


Are any of these statments about right and which one would you
recomend?


Thanks


Trev

  #6  
Old May 18th, 2007, 10:35 PM
salad
Guest
 
Posts: n/a
Default Re: can a table be opened in access by todays date

Trev wrote:
Quote:
On 17 May, 19:05, salad <o...@vinegar.comwrote:
>
Quote:
>>Trev wrote:
>>
Quote:
>>>Hi
>>>Can anyone point me in the right direction here, I would like to open
>>>a table in access 2003 by date. I have an asp web page which needs to
>>>read data from a table with each days today's date (which ever day
>>>that is) then a new table is created with today's date.
>>
Quote:
>>>Example:
>>>I have a table called 17-may-2007 my ASP page reads this table for
>>>24hours then tomorrow (12:00 midnight 18th) I will have a new table
>>>called 18-may-2007 and the old table is left behind (As 17-may-2007)
>>>so I need my sql statement to automatically open table by today's
>>>date.
>>
>>What is "today"? Since this is ASP, you might get hits from anywhere in
>>the world. So is "today" the same day as the surfer or is today the
>>network date where the file is stored?
>>
>>You are opening a can of worms that will bite you in the butt later on.
>>
>>
>>
>>
>>
>>
Quote:
>>>This is what I have so far but it does not work. Any ideas
>>
Quote:
>>>'---------------Start of code---------------
>>>Call BarGraphSQLData( _
>> "SELECT id, DataReading FROM DAY(CURRENT_TIMESTAMP) ORDER BY id" ,
>>>_
>> "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
>>>Server.MapPath("db/data.mdb") & ";" , _
>>
Quote:
>>>'---------------End of code---------------
>>
Quote:
>>>Thanks
>>
Quote:
>>>Trevor- Hide quoted text -
>>
>>- Show quoted text -
>
>
Thats why i'm not a programmer or a db designer LOL, ok i get the hit
- what about this option......
>
todays ping stats which is when i posted this stuff, would be saved in
the
table as 17-may-2007 then tomorrows ping stats would be saved in the
same
table as 18-may-2007 and so on, then on each asp page would select
that days date i guess i would use a stament
>
Something like:
>
"SELECT today=now(), DataReading FROM tbldata ORDER BY id" , _
>
or
>
"SELECT DAY(CURRENT_TIMESTAMP), DataReading FROM tbldata ORDER BYid" ,
_
>
Are any of these statments about right and which one would you
recomend?
Thanks
>
Trev
>
One thing about Now() vs Date. Now is a true time stamp; day hr mn sec
whereas Date is simply the date. So sometimes people will ask why no
records were returned when the do something like
Where NowField = Date

Date is the day with a time of 00:00:00. Midnight. So the only records
returned would be those that have a date/time stamp of exacly midnight.
You would need to check for records between today and tomorrow to
catch all records in today since 05/18/2005 will never equal a record
with 05/18/2007 00:00:01

In Access, it might be something like

Select ID, DataReading From YourTableName
Where CURRENT_TIMESTAMP
Between "#" & Date & "#" And "#" & Date + 1 & "#"
Order By Current_TimeStamp

This would select the record ID, the reading from your table where the
timestamp is between today and tomorrow and you are sorting it on the
timestamp field. You might need to make some adjustments for your ASP.


  #7  
Old May 22nd, 2007, 02:15 PM
Trev
Guest
 
Posts: n/a
Default Re: can a table be opened in access by todays date

On 18 May, 22:30, salad <o...@vinegar.comwrote:
Quote:
Trev wrote:
Quote:
On 17 May, 19:05, salad <o...@vinegar.comwrote:
>
Quote:
Quote:
>Trev wrote:
>
Quote:
Quote:
>>Hi
>>Can anyone point me in the right direction here, I would like to open
>>a table in access 2003 by date. I have an asp web page which needs to
>>read data from a table with each days today's date (which ever day
>>that is) then a new table is created with today's date.
>
Quote:
Quote:
>>Example:
>>I have a table called 17-may-2007 my ASP page reads this table for
>>24hours then tomorrow (12:00 midnight 18th) I will have a new table
>>called 18-may-2007 and the old table is left behind (As 17-may-2007)
>>so I need my sql statement to automatically open table by today's
>>date.
>
Quote:
Quote:
>What is "today"? Since this is ASP, you might get hits from anywhere in
>the world. So is "today" the same day as the surfer or is today the
>network date where the file is stored?
>
Quote:
Quote:
>You are opening a can of worms that will bite you in the butt later on.
>
Quote:
Quote:
>>This is what I have so far but it does not work. Any ideas
>
Quote:
Quote:
>>'---------------Start of code---------------
>>Call BarGraphSQLData( _
> "SELECT id, DataReading FROM DAY(CURRENT_TIMESTAMP) ORDER BY id" ,
>>_
> "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
>>Server.MapPath("db/data.mdb") & ";" , _
>
Quote:
Quote:
>>'---------------End of code---------------
>
Quote:
Quote:
>>Thanks
>
Quote:
Quote:
>>Trevor- Hide quoted text -
>
Quote:
Quote:
>- Show quoted text -
>
Quote:
Thats why i'm not a programmer or a db designer LOL, ok i get the hit
- what about this option......
>
Quote:
todays ping stats which is when i posted this stuff, would be saved in
the
table as 17-may-2007 then tomorrows ping stats would be saved in the
same
table as 18-may-2007 and so on, then on each asp page would select
that days date i guess i would use a stament
>
Quote:
Something like:
>
Quote:
"SELECT today=now(), DataReading FROM tbldata ORDER BY id" , _
>
Quote:
or
>
Quote:
"SELECT DAY(CURRENT_TIMESTAMP), DataReading FROM tbldata ORDER BYid" ,
_
>
Quote:
Are any of these statments about right and which one would you
recomend?
Thanks
>
Quote:
Trev
>
One thing about Now() vs Date. Now is a true time stamp; day hr mn sec
whereas Date is simply the date. So sometimes people will ask why no
records were returned when the do something like
Where NowField = Date
>
Date is the day with a time of 00:00:00. Midnight. So the only records
returned would be those that have a date/time stamp of exacly midnight.
You would need to check for records between today and tomorrow to
catch all records in today since 05/18/2005 will never equal a record
with 05/18/2007 00:00:01
>
In Access, it might be something like
>
Select ID, DataReading From YourTableName
Where CURRENT_TIMESTAMP
Between "#" & Date & "#" And "#" & Date + 1 & "#"
Order By Current_TimeStamp
>
This would select the record ID, the reading from your table where the
timestamp is between today and tomorrow and you are sorting it on the
timestamp field. You might need to make some adjustments for your ASP.- Hide quoted text -
>
- Show quoted text -
Hi,
Just to let you know

I have now solved this by the extra bit of info from Salad


Thanks, for everyone's help.

Trev

  #8  
Old May 22nd, 2007, 05:05 PM
Trev
Guest
 
Posts: n/a
Default Re: can a table be opened in access by todays date

On 18 May, 22:30, salad <o...@vinegar.comwrote:
Quote:
Trev wrote:
Quote:
On 17 May, 19:05, salad <o...@vinegar.comwrote:
>
Quote:
Quote:
>Trev wrote:
>
Quote:
Quote:
>>Hi
>>Can anyone point me in the right direction here, I would like to open
>>a table in access 2003 by date. I have an asp web page which needs to
>>read data from a table with each days today's date (which ever day
>>that is) then a new table is created with today's date.
>
Quote:
Quote:
>>Example:
>>I have a table called 17-may-2007 my ASP page reads this table for
>>24hours then tomorrow (12:00 midnight 18th) I will have a new table
>>called 18-may-2007 and the old table is left behind (As 17-may-2007)
>>so I need my sql statement to automatically open table by today's
>>date.
>
Quote:
Quote:
>What is "today"? Since this is ASP, you might get hits from anywhere in
>the world. So is "today" the same day as the surfer or is today the
>network date where the file is stored?
>
Quote:
Quote:
>You are opening a can of worms that will bite you in the butt later on.
>
Quote:
Quote:
>>This is what I have so far but it does not work. Any ideas
>
Quote:
Quote:
>>'---------------Start of code---------------
>>Call BarGraphSQLData( _
> "SELECT id, DataReading FROM DAY(CURRENT_TIMESTAMP) ORDER BY id" ,
>>_
> "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
>>Server.MapPath("db/data.mdb") & ";" , _
>
Quote:
Quote:
>>'---------------End of code---------------
>
Quote:
Quote:
>>Thanks
>
Quote:
Quote:
>>Trevor- Hide quoted text -
>
Quote:
Quote:
>- Show quoted text -
>
Quote:
Thats why i'm not a programmer or a db designer LOL, ok i get the hit
- what about this option......
>
Quote:
todays ping stats which is when i posted this stuff, would be saved in
the
table as 17-may-2007 then tomorrows ping stats would be saved in the
same
table as 18-may-2007 and so on, then on each asp page would select
that days date i guess i would use a stament
>
Quote:
Something like:
>
Quote:
"SELECT today=now(), DataReading FROM tbldata ORDER BY id" , _
>
Quote:
or
>
Quote:
"SELECT DAY(CURRENT_TIMESTAMP), DataReading FROM tbldata ORDER BYid" ,
_
>
Quote:
Are any of these statments about right and which one would you
recomend?
Thanks
>
Quote:
Trev
>
One thing about Now() vs Date. Now is a true time stamp; day hr mn sec
whereas Date is simply the date. So sometimes people will ask why no
records were returned when the do something like
Where NowField = Date
>
Date is the day with a time of 00:00:00. Midnight. So the only records
returned would be those that have a date/time stamp of exacly midnight.
You would need to check for records between today and tomorrow to
catch all records in today since 05/18/2005 will never equal a record
with 05/18/2007 00:00:01
>
In Access, it might be something like
>
Select ID, DataReading From YourTableName
Where CURRENT_TIMESTAMP
Between "#" & Date & "#" And "#" & Date + 1 & "#"
Order By Current_TimeStamp
>
This would select the record ID, the reading from your table where the
timestamp is between today and tomorrow and you are sorting it on the
timestamp field. You might need to make some adjustments for your ASP.- Hide quoted text -
>
- Show quoted text -
Hi,
Just to let you know

I have now solved this by the extra bit of info from Salad


Thanks, for everyone's help.

Trev

  #9  
Old May 22nd, 2007, 05:15 PM
Trev
Guest
 
Posts: n/a
Default Re: can a table be opened in access by todays date

On 18 May, 22:30, salad <o...@vinegar.comwrote:
Quote:
Trev wrote:
Quote:
On 17 May, 19:05, salad <o...@vinegar.comwrote:
>
Quote:
Quote:
>Trev wrote:
>
Quote:
Quote:
>>Hi
>>Can anyone point me in the right direction here, I would like to open
>>a table in access 2003 by date. I have an asp web page which needs to
>>read data from a table with each days today's date (which ever day
>>that is) then a new table is created with today's date.
>
Quote:
Quote:
>>Example:
>>I have a table called 17-may-2007 my ASP page reads this table for
>>24hours then tomorrow (12:00 midnight 18th) I will have a new table
>>called 18-may-2007 and the old table is left behind (As 17-may-2007)
>>so I need my sql statement to automatically open table by today's
>>date.
>
Quote:
Quote:
>What is "today"? Since this is ASP, you might get hits from anywhere in
>the world. So is "today" the same day as the surfer or is today the
>network date where the file is stored?
>
Quote:
Quote:
>You are opening a can of worms that will bite you in the butt later on.
>
Quote:
Quote:
>>This is what I have so far but it does not work. Any ideas
>
Quote:
Quote:
>>'---------------Start of code---------------
>>Call BarGraphSQLData( _
> "SELECT id, DataReading FROM DAY(CURRENT_TIMESTAMP) ORDER BY id" ,
>>_
> "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
>>Server.MapPath("db/data.mdb") & ";" , _
>
Quote:
Quote:
>>'---------------End of code---------------
>
Quote:
Quote:
>>Thanks
>
Quote:
Quote:
>>Trevor- Hide quoted text -
>
Quote:
Quote:
>- Show quoted text -
>
Quote:
Thats why i'm not a programmer or a db designer LOL, ok i get the hit
- what about this option......
>
Quote:
todays ping stats which is when i posted this stuff, would be saved in
the
table as 17-may-2007 then tomorrows ping stats would be saved in the
same
table as 18-may-2007 and so on, then on each asp page would select
that days date i guess i would use a stament
>
Quote:
Something like:
>
Quote:
"SELECT today=now(), DataReading FROM tbldata ORDER BY id" , _
>
Quote:
or
>
Quote:
"SELECT DAY(CURRENT_TIMESTAMP), DataReading FROM tbldata ORDER BYid" ,
_
>
Quote:
Are any of these statments about right and which one would you
recomend?
Thanks
>
Quote:
Trev
>
One thing about Now() vs Date. Now is a true time stamp; day hr mn sec
whereas Date is simply the date. So sometimes people will ask why no
records were returned when the do something like
Where NowField = Date
>
Date is the day with a time of 00:00:00. Midnight. So the only records
returned would be those that have a date/time stamp of exacly midnight.
You would need to check for records between today and tomorrow to
catch all records in today since 05/18/2005 will never equal a record
with 05/18/2007 00:00:01
>
In Access, it might be something like
>
Select ID, DataReading From YourTableName
Where CURRENT_TIMESTAMP
Between "#" & Date & "#" And "#" & Date + 1 & "#"
Order By Current_TimeStamp
>
This would select the record ID, the reading from your table where the
timestamp is between today and tomorrow and you are sorting it on the
timestamp field. You might need to make some adjustments for your ASP.- Hide quoted text -
>
- Show quoted text -
Hi,
Just to let you know

I have now solved this by the extra bit of info from Salad


Thanks, for everyone's help.

Trev

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles