niralibaan
21st August 2010, 15:32
Hi,
Can anyone tell me how can i change date format?I am facing following issue:

extern domain tcdate date.f,date.t

select whinh312.*
from whinh312
where whinh312.ardt inrange {:date.f} and {:date.t}
selectdo
endselect

In whinh312 table 'ardt' column is of type 'tcdate' domain and its having value "2009-04-01 15:18:44" (in this format) and variable date.f and date.t is getting value "712012" and "301222" format.So while comparing this variables with ardt column no data found is coming though there is data having date range in am providing as input.
So pls tell me how cn i cast date.f and date.t variables in 2009-04-01 15:18:44 format?

Regards,
Nirali




|

mast_aadmi
22nd August 2010, 07:20
Hi,
Can anyone tell me how can i change date format?I am facing following issue:

extern domain tcdate date.f,date.t

select whinh312.*
from whinh312
where whinh312.ardt inrange {:date.f} and {:date.t}
selectdo
endselect

In whinh312 table 'ardt' column is of type 'tcdate' domain and its having value "2009-04-01 15:18:44" (in this format) and variable date.f and date.t is getting value "712012" and "301222" format.So while comparing this variables with ardt column no data found is coming though there is data having date range in am providing as input.
So pls tell me how cn i cast date.f and date.t variables in 2009-04-01 15:18:44 format?

Regards,
Nirali




|

That is not the problem for sure. The date formats you are using are correct. The domain tcdate is UTC Date/Time type data type which stores the date values as the no of seconds from 12 am 1 Jan 1970 that is why you are seeing those nos. For more help you can refer to program guide. The query seems fine.
If the above values that you posted are the values with which you are testing then the problem is that the field date.t has a lower value than the field date.f that's why the query is not selecting any records.
Try selecting a the from date lower than to date.

bdittmar
22nd August 2010, 19:26
Hi,
Can anyone tell me how can i change date format?I am facing following issue:

extern domain tcdate date.f,date.t

select whinh312.*
from whinh312
where whinh312.ardt inrange {:date.f} and {:date.t}
selectdo
endselect

In whinh312 table 'ardt' column is of type 'tcdate' domain and its having value "2009-04-01 15:18:44" (in this format) and variable date.f and date.t is getting value "712012" and "301222" format.So while comparing this variables with ardt column no data found is coming though there is data having date range in am providing as input.
So pls tell me how cn i cast date.f and date.t variables in 2009-04-01 15:18:44 format?

Regards,
Nirali




|

Hello,

from LN progguide:

Dates, times, time zones synopsis
Local dates/times

long date.num() ( )
string date.to.inputstr$() ( long dayno, string format(7), long length )
long date.to.num() ( long yearno, long monthno, long month_dayno )
string dte$() ( )
long inputstr.to.date() ( string inputstr(.), string format(7) )
long num.to.date() ( long dayno, ref long yearno, ref long monthno, ref long month_dayno )
string num.to.date$() ( long dayno, long mode )
long num.to.week() ( long dayno, ref long week_dayno, ref long year_dayno, ref long weekno [, ref long yearno] )
long time.num() ( )
long week.to.num() ( long weekno, long yearno, long week_dayno )

UTC conversion

long date.to.utc() ( long yearno, long monthno, long month_dayno, long hours, long minutes, long seconds )
long date.with.timezone.info.to.utc() ( long yearno, long monthno, long month_dayno, long hours, long minutes, long seconds, long utcdiff )
long input.to.utc() ( const string value(), const string format() )
long inputstr.to.utc() ( const string date.inputstr(), string date.format(7), const string time.inputstr(), string time.format(7) )
long local.to.utc() ( long local_days, long local_time, ref long utc [, string local_dst] )
long local.with.timezone.info.to.utc() ( long local_days, long local_time, long utcdiff, ref long utc )
long utc.num() ( )
long utc.add() ( long i.utc, long year, long month, long day, long hour, long minutes, long second, ref long o.utc )
long utc.to.date() ( long utc, ref long yearno, ref long monthno, ref long month_dayno, ref long hours, ref long minutes, ref long seconds )
long utc.to.date.with.timezone.info() ( long utc, ref long yearno, ref long monthno, ref long month_dayno, ref long hours, ref long minutes, ref long seconds, ref long utcdiff )
long utc.to.input() ( long lvalue, const string format() )
long utc.to.inputstr$() ( long utc, string date.format(7), string time.format(7), ref string local.date(), ref string local.time() )
long utc.to.local() ( long utc, ref long local_days, ref long local_time [, ref string local_dst] )
long utc.to.local.with.timezone.info() ( long utc, ref long local_days, ref long local_time, ref long utcdiff )
long utc.to.week() ( long utc, ref long week_dayno, ref long year_dayno, ref long weekno, ref long hours, ref long minutes, ref long seconds [, ref long yearno] )
long week.to.utc() ( long weekno, long yearno, long week_dayno, long hours, long minutes, long seconds )
string utc.to.iso() ( long utc, long format )
long iso.to.utc() ( const string iso.string )

Time zones

long choose.time.zone.from.list() ( )
long date.to.date() ( long in_date, long in_time, const string in_zone(), const string out_zone(), ref long out_date, ref long out_time )
long get.time.zone() ( ref string time_zone() )
long set.time.zone() ( string time_zone(50) )
boolean timezone.exists() ( string time_zone(50) )

Regards