Getting just time from datetime fields

I have some datetime fields that I want to get just the time
out of.  I know I can get the date by using
"date(fieldname)", but I haven't found an equivalent
"time(fieldname)".  Is there a way to do this?  I am using
Infomaker 10.  Thanks
0
Tom
11/14/2005 9:37:12 PM
sybase.infomaker.general 4461 articles. 0 followers. Follow

6 Replies
1238 Views

Similar Articles

[PageSpeed] 45

On 14 Nov 2005 13:37:12 -0800, Tom Minich wrote:

>I have some datetime fields that I want to get just the time
>out of.  I know I can get the date by using
>"date(fieldname)", but I haven't found an equivalent
>"time(fieldname)".  Is there a way to do this?  I am using
>Infomaker 10.  Thanks

Hmm... Are you sure you don't see the Time() function?  It should be
there.
0
Boris
11/15/2005 1:49:10 PM
If you don't see the function, you can always pull in the field and format 
it to display only the time using a format similar to hh:mm:ss am/pm or some 
variation.
<Tom Minich> wrote in message news:43790207.1659.1681692777@sybase.com...
>I have some datetime fields that I want to get just the time
> out of.  I know I can get the date by using
> "date(fieldname)", but I haven't found an equivalent
> "time(fieldname)".  Is there a way to do this?  I am using
> Infomaker 10.  Thanks 


0
Matthew
11/16/2005 3:17:35 PM
> On 14 Nov 2005 13:37:12 -0800, Tom Minich wrote:
>
> >I have some datetime fields that I want to get just the
> time >out of.  I know I can get the date by using
> >"date(fieldname)", but I haven't found an equivalent
> >"time(fieldname)".  Is there a way to do this?  I am
> using >Infomaker 10.  Thanks
>
> Hmm... Are you sure you don't see the Time() function?  It
> should be there.

The help file discusses one, but I get an error - Routine
(time) cannot be resolved.
0
Thomas
11/16/2005 4:22:26 PM
> If you don't see the function, you can always pull in the
> field and format  it to display only the time using a
> format similar to hh:mm:ss am/pm or some  variation.
> <Tom Minich> wrote in message
> news:43790207.1659.1681692777@sybase.com... >I have some
> > datetime fields that I want to get just the time out of.
> >  I know I can get the date by using "date(fieldname)",
> > but I haven't found an equivalent "time(fieldname)".  Is
> > there a way to do this?  I am using Infomaker 10.
> Thanks
>
>
I can format the field if I'm writing a report, but it can't
be done in a query as far as I know.
0
Thomas
11/16/2005 4:24:17 PM
If you are doing this in the SQL statement, we'll need to know what database
you are using.

-- 
Terry Dykstra (TeamSybase)
http://powerbuilder.codeXchange.sybase.com/
http://www.pb9books.com
product enhancement requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement


<Thomas Minich> wrote in message news:437b5d31.4b7e.1681692777@sybase.com...
> > If you don't see the function, you can always pull in the
> > field and format  it to display only the time using a
> > format similar to hh:mm:ss am/pm or some  variation.
> > <Tom Minich> wrote in message
> > news:43790207.1659.1681692777@sybase.com... >I have some
> > > datetime fields that I want to get just the time out of.
> > >  I know I can get the date by using "date(fieldname)",
> > > but I haven't found an equivalent "time(fieldname)".  Is
> > > there a way to do this?  I am using Infomaker 10.
> > Thanks
> >
> >
> I can format the field if I'm writing a report, but it can't
> be done in a query as far as I know.


0
Terry
11/17/2005 12:27:45 AM
On 16 Nov 2005 16:27:45 -0800, "Terry Dykstra"
<tddykstra@forestoil.ca> wrote:

>If you are doing this in the SQL statement, we'll need to know what database
>you are using.

SQL Statement!  Of coarse...   You're goood..

[Wrapping tin foil over my head so Terry can't hear me <g>]
0
Boris
11/17/2005 1:25:21 PM
Reply:

Similar Artilces:

Get the time from a DateTime Field
  I looked at this post and it didn't work for me.   Trying to extract the time portion from a datetime field. ex  7:15:12 AM from    1/1/2008 7:15:12 aM This is what I tried and neither functions give me the results I want....  SELECT     DueTime, CONVERT(varchar, DueDate, 108) AS Expr1, SUBSTRING(CAST(DueDate AS varchar), 10, LEN(DueDate)) AS Expr2, CAST(DueDate AS varchar)                       AS Expr3FROM  ...

getting just the date or from DateTime field
Hi, I have used smalldatetime datatype to store my date and time values. i want to store just the date or time but the problem is it stores both the date and time. For eg, if i add the the date 03/11/2004, it also the stores the current time automatically. so the new value will be something like 03/11/2004 10:00:00 AM where i want just 03/11/2004. further problem is even though i managed to store just the date like 03/11/2004 in the database, whole date and time shows up when i display it in my pages. any help will be appreciated. thanx,-keeara g------------------ If i want to dis...

how to get time value from datetime field?
dear friends..................                   i have a table like below..  name                                    date                                  &n...

How can I get the amount of time between two datetime fields
I have to datetime fields and would like to create a procedure to calculate the difference between the two time portions of the daatetime entries 11/29/2006 12:00:00 PM 11/29/2006 05:00:00 PM Equals 5 Any help is appreciated.Thank youJackxxx Using System.DateTime objects, you can use the Subtract method to obtain a TimeSpan and then use either its Hours or TotalHours properties to obtain the difference in hours between them.RegardsDave try this: Dim d1 As Date = CType("11/29/2006 12:00:00 PM", Date) Dim d2 As Date = CType("11/29/2006 05:00:00 PM", Date) ...

can i format a datetime value to just get the time of day?
at the moment i have <%#Eval("PublishDate", "{0:dd MMMM yyyy}")%> which produces something like 30 August 2007. but i nopw need to get at the time of day only. Is this possible? like this:<%#Eval("PublishDate", "{0:hh mm ss}")%>  Mike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/ Thanks...

Converting Date field and Time field to DateTime
D2007 We are converting data for a new customer. The old data has a field for 'updt-dt' which is a Date field. The old data has a field for 'updt-tm' which is an Integer field. We need to combine to have a DateTimeStamp. var OldDate, OldTime : TDateTime; looping FieldNameFrom := 'updt-dt'; FieldNameFrom2 := 'updt-tm'; if (not FieldByName(FieldNameFrom).IsNull) and (not FieldByName(FieldNameFrom2).IsNull) then begin Day := 0; Month := 0; Year := 0; ...

Date Time field return just time
 Hi, I have a data/time field in access which is queried using a datasource linked to a check box list, the field contains only hh:mm but is returning dd/mm/yyyy hh:mm, does anyone know how to just return hh:mm? Thanks  Hi, It will return complete date and timestamp so if you want the same to be displayed in hh:mm format then while qerying you will need to format the feild if you want it in hh:mm.  ThanksAshishhttp://itsmeashish.blogspot.com...

just Time or date portion of a date/time field
Good Day, From a DateTime data column how do I get just a Time portin or just a date portion of data to be displayed. i.e from 11/6/2003 10:03:20 AM I need to display date and time seperately in my data display page. Thanks Regards, In code you could use Dim dt as System.Date Dim day, month, year as integer day = dt.Day month= dt.Month year = dt.Year This also works with DateTime In SQL you could use DATEPART(<datepart>,<datetime>) where <datepart> is the abbreviations mentioned in post 385301 and <datetime> is a...

just Time or date portion of date/time field: SOMEBODY PLS
Good Day, From a DateTime data column how do I get just a Time portin or just a date portion of data to be displayed. i.e from 11/6/2003 10:03:20 AM I need to display date and time seperately in my data display page. Thanks Regards, When you pull in a SQL datetime column value into your .NET code, it is usually cast to a .NET DateTime type... something like this: System.DateTime TheDateAndTime = (System.DateTime)someDataReader["MySQLDateColumn"] Then you can use a variety of .NET methods included in the DateTime class to convert to a strin...

how to get time from datetime?
 Hi,I read a data form datetime type field in SQL server 2005.I want to save it to two variables.one is used save date information(like 05 20,2008) .other is used for time (like 4:10:20)Please give me a idea how to do this.Thanks Mark       Try using the DATEPART or the DATENAME function    Datename: http://sqltutorials.blogspot.com/2007/05/sql-datename.html  Datepart: http://sqltutorials.blogspot.com/2007/06/sql-dateparts-and-abbreviations.htmlDon't forget to click "Mark as Answer" on the post that helped you. After you...

Get Datetime from a float field
HiI have been trying to get a field from my db to display a date.My problem is that the data type of the field in the db is a "float" with a length of 8.I'm a newbie C# programmer, so plase be kind on me :)I only resive a number when i try to get a date from the field like "39485" Any one have an example on how to convert a float to a date? Or can direct me to some material I can study.Been looking on the net, but it seems I'm searching with the wrong key words.  If it is an OLE Automation date (and it looks like it is) then... DateTime MyDate =...

My datetime field getting errors
I retrieve records using stored procedure into DataRow called "row".  Now I getting error about DBNull and the field seems to contain {} values. Server Error in '/Web' Application. Object cannot be cast from DBNull to other types. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Object cannot be cast from DBNull to other types.Source Error: Line 103: decimal ...

Insert TIME only in DateTime field
I am doing a temporary retro-upgrade right now. So, I know this isn't exactly in the scope of ASP.Net. Ordinally my posts are. However, I need a VBScript example of how to insert the Date only into the DateTime field of an SQL 2000 Server. By default, if you try to, the server automatically adds the date "1/1/1900". Can anyone help me please?Willhttp://www.strohlsitedesign.com/http://www.WillStrohl.com/ That is how datetime fields work. You need to address this using formatting on the client side. DateTime has a number of useful ToString() overloads.Starting with ASP.NET 2...

Getting parts of DateTime field
Hi everyone, I want to get year, month, day and time parts of a DateTime field in sql, Can help me? There are many datetime functions you can use. For example: You can use Year(dtColumn), Month(dtColumn) to get year and month returned in integer format. You can also  use DATEPART function to get the part you want, for example: Datepart(yyyy,dtColumn) to get year. Here is the full list from MSDN library: http://msdn.microsoft.com/en-us/library/ms174420.aspx    Limno...

Web resources about - Getting just time from datetime fields - sybase.infomaker.general

Is there a JQuery plugin to convert UTC datetimes to local user timezone?
If I have a tag: &lt;span class="utctime"&gt;2010-01-01 11:30 PM&lt;/span&gt; I would like a jquery script or plug in to convert every utctime ...


Targetprocess 3.7.3: Epic unit for Bug/Story cards, new DateTime functions in Webhook plugin
Webhook plugin supports new DateTime functions AddDays(DateTime date, int days) – Returns a new date with the number of days added. The number ...

Common Pitfalls when working with DateTime’s
In .NET, the DateTime structure provides us wonderful functionality, but this seemingly simple structure can cause a lot of headaches if you ...

Parsing Twitter Date format to .Net DateTime
Recently when I needed to parse the twitter datetime format into a .Net DateTime I found this post on the web showing how to do it. However, ...

C Sharp (programming language) - Wikipedia, the free encyclopedia
(pronounced see sharp ) is a multi-paradigm programming language encompassing strong typing , imperative , declarative , functional , generic ...

1753 - Wikipedia, the free encyclopedia
Language: English Afrikaans አማርኛ العربية Aragonés Asturianu Aymar aru Azərbaycanca বাংলা Bân-lâm-gú Basa Banyumasan Беларуская ‪Беларуская (тарашкевіца)‬ ...

Coded Smorgasbord: Schizophrenic Haiku Comments and More
... writes Malcom StandardResponse UnSubscribeNewsletterUserAccount( string opTinGUID,string email, string sellingRegion, string source, DateTime ...

Limburg.be - Welkom op de site van de provincie Limburg - Welkom_op_de_site_van_de_provincie_Limburg
visit wonen werken leven ontspannen infopunt home op trefwoord contactpersonen wegwijs sitemap print deze pagina Je bent hier: limburg.be Contact ...

Simples Ideias. Por Nando Vieira.
Simples Ideias Siga-me no Twitter Junho/2012 Usando o Vagrant como ambiente de desenvolvimento no Windows http://simplesideias.com.br/usando ...

Resources last updated: 12/11/2015 10:09:24 AM