Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

time function in SQL???

Status
Not open for further replies.

anneoctaaf

Programmer
Dec 15, 2003
104
NL
In my database there is a datetime record. Now i only need the time from the database. Is there a sql function that can filter the time from my datetime record? I mean something like this:

SELECT time(value)
FROM Globals;
 
In MS SQL Server you can use the following:

select convert(varchar(8),getdate(),8)

Which gives you the current time.

or

select convert(varchar(8), colname,8) from table

where colname is the datetime column.
 
msaccess, which should be able to handle some string function like the example above...thanx!
 
It looks like you have to do the work yourself...


SELECT {fn hour(table.datefield)},
{fn minute(table.datefield)}
FROM table ;
[/color blue]

Where table is the table of interest and datefield is the field containing the time you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top