Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Oracle / Oracle Server / January 2008

Tip: Looking for answers? Try searching our database.

TimeStamp

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
FeedingFrenzy1947@gmail.com - 29 Jan 2008 19:39 GMT
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
Frank van Bortel - 29 Jan 2008 19:48 GMT
> Hi all,
> I am trying to construct a query tool in VB6.
[quoted text clipped - 3 lines]
> 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/B19306_01/server.102/b14200/sql_elements004.h
tm#i34924

Signature


Regards,
Frank van Bortel

Top-posting in UseNet newsgroups is one way to shut me up

FeedingFrenzy1947@gmail.com - 29 Jan 2008 20:40 GMT
On Jan 29, 2:48 pm, Frank van Bortel <frank.van.bor...@gmail.com>
wrote:
> FeedingFrenzy1...@gmail.com wrote:
> > Hi all,
[quoted text clipped - 28 lines]
>
> 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
news.verizon.net - 30 Jan 2008 06:02 GMT
On Jan 29, 2:48 pm, Frank van Bortel <frank.van.bor...@gmail.com>
wrote:
> FeedingFrenzy1...@gmail.com wrote:
> > Hi all,
[quoted text clipped - 28 lines]
>
> 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.