dbTalk Databases Forums  

TimeStamp

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss TimeStamp in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
news.verizon.net
 
Posts: n/a

Default Re: TimeStamp - 01-30-2008 , 12:02 AM







<FeedingFrenzy1947 (AT) gmail (DOT) com> wrote

On Jan 29, 2:48 pm, Frank van Bortel <frank.van.bor... (AT) gmail (DOT) com>
wrote:
Quote:
FeedingFrenzy1... (AT) gmail (DOT) com wrote:
Hi all,
I am trying to construct a query tool in VB6.
This is all i want my query to perform:
Select * from table where timestamp_field = Date.text
Any help?
Thanks,
FF

Timestamps in oracle are not text - their representation
on screen is. Dates are just like that, but have less
resolution (1 second for date, 1 nanosecond (10^-9 sec)
for a timestamp).
Having said that - the representation depends on what
format you have defined to show timestamps in. There's
always a default, so you'll always see 'something'.

Relying on the default format mask is a dangerous thing
to do - therefor, always do an explicit conversion:
select * from table
where timestamp = to_timestamp(date.text,'format_mask');
format_mask is the generic text representation of how
your Date.text looks like.
Definition of format masks for datetime elements can
be found in the SQL Reference manual on tahiti.oracle.com,
specifically:http://download.oracle.com/docs/cd/B.../b14200/sql_el...
--

Regards,
Frank van Bortel

Top-posting in UseNet newsgroups is one way to shut me up
Hi Frank,
I have a field called Time_end in my database which has the TimeStamp
datatype.
i am trying to get input from the user in a textbox
txtDate.Text = Format(txtDate.Text, "dd-mmm-yyyy")

Now i want to get all the values in my time_end field which were on
the same date.

How do i do this?
Thanks

select * form mytable where thedate>= to_date(txtDate.Text,'dd-mon-yyyy')
and
thedate<=(to_date(txtDate.Text,'dd-mon-yyyy') +1)

Remember to use bind variables in your queries
Jim




Reply With Quote
  #12  
Old   
news.verizon.net
 
Posts: n/a

Default Re: TimeStamp - 01-30-2008 , 12:02 AM







<FeedingFrenzy1947 (AT) gmail (DOT) com> wrote

On Jan 29, 2:48 pm, Frank van Bortel <frank.van.bor... (AT) gmail (DOT) com>
wrote:
Quote:
FeedingFrenzy1... (AT) gmail (DOT) com wrote:
Hi all,
I am trying to construct a query tool in VB6.
This is all i want my query to perform:
Select * from table where timestamp_field = Date.text
Any help?
Thanks,
FF

Timestamps in oracle are not text - their representation
on screen is. Dates are just like that, but have less
resolution (1 second for date, 1 nanosecond (10^-9 sec)
for a timestamp).
Having said that - the representation depends on what
format you have defined to show timestamps in. There's
always a default, so you'll always see 'something'.

Relying on the default format mask is a dangerous thing
to do - therefor, always do an explicit conversion:
select * from table
where timestamp = to_timestamp(date.text,'format_mask');
format_mask is the generic text representation of how
your Date.text looks like.
Definition of format masks for datetime elements can
be found in the SQL Reference manual on tahiti.oracle.com,
specifically:http://download.oracle.com/docs/cd/B.../b14200/sql_el...
--

Regards,
Frank van Bortel

Top-posting in UseNet newsgroups is one way to shut me up
Hi Frank,
I have a field called Time_end in my database which has the TimeStamp
datatype.
i am trying to get input from the user in a textbox
txtDate.Text = Format(txtDate.Text, "dd-mmm-yyyy")

Now i want to get all the values in my time_end field which were on
the same date.

How do i do this?
Thanks

select * form mytable where thedate>= to_date(txtDate.Text,'dd-mon-yyyy')
and
thedate<=(to_date(txtDate.Text,'dd-mon-yyyy') +1)

Remember to use bind variables in your queries
Jim




Reply With Quote
  #13  
Old   
news.verizon.net
 
Posts: n/a

Default Re: TimeStamp - 01-30-2008 , 12:02 AM




<FeedingFrenzy1947 (AT) gmail (DOT) com> wrote

On Jan 29, 2:48 pm, Frank van Bortel <frank.van.bor... (AT) gmail (DOT) com>
wrote:
Quote:
FeedingFrenzy1... (AT) gmail (DOT) com wrote:
Hi all,
I am trying to construct a query tool in VB6.
This is all i want my query to perform:
Select * from table where timestamp_field = Date.text
Any help?
Thanks,
FF

Timestamps in oracle are not text - their representation
on screen is. Dates are just like that, but have less
resolution (1 second for date, 1 nanosecond (10^-9 sec)
for a timestamp).
Having said that - the representation depends on what
format you have defined to show timestamps in. There's
always a default, so you'll always see 'something'.

Relying on the default format mask is a dangerous thing
to do - therefor, always do an explicit conversion:
select * from table
where timestamp = to_timestamp(date.text,'format_mask');
format_mask is the generic text representation of how
your Date.text looks like.
Definition of format masks for datetime elements can
be found in the SQL Reference manual on tahiti.oracle.com,
specifically:http://download.oracle.com/docs/cd/B.../b14200/sql_el...
--

Regards,
Frank van Bortel

Top-posting in UseNet newsgroups is one way to shut me up
Hi Frank,
I have a field called Time_end in my database which has the TimeStamp
datatype.
i am trying to get input from the user in a textbox
txtDate.Text = Format(txtDate.Text, "dd-mmm-yyyy")

Now i want to get all the values in my time_end field which were on
the same date.

How do i do this?
Thanks

select * form mytable where thedate>= to_date(txtDate.Text,'dd-mon-yyyy')
and
thedate<=(to_date(txtDate.Text,'dd-mon-yyyy') +1)

Remember to use bind variables in your queries
Jim




Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.