Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access 7.1.259
  HXTT Cobol 5.0.258
  HXTT DBF 7.1.260
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel 6.1.262
  HXTT Json 1.0.230
  HXTT Paradox 7.1.258
  HXTT PDF 2.0.258
  HXTT Text(CSV) 7.1.258
  HXTT Word 1.1.258
  HXTT XML 4.0.259
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT DBF
date issue
Srinivas
2010-07-13 05:03:39
Hi,
I am using below query to get the most recent date from mdb.
select max(date(exam_date)) from exam

mdb has following dates :-
1/7/2010 1:44:38 PM
1/7/2010 11:44:39 AM
1/7/2010 12:44:37 AM
1/7/2010 9:44:36 AM

application returns 1/7/2010 9:44:36 AM instead of 1/7/2010 1:44:38 PM ( it does not work for time).
however it works for the date, when following date exist in mdb:-
1/7/2010 1:44:38 PM
4/7/2010 11:44:39 AM
7/7/2010 12:44:37 AM
6/7/2010 9:44:36 AM

it returns 7/7/2010 12:44:37 AM

Can you please provide me the solution for this.

Thanks,
Srinivas
Re:date issue
HXTT Support
2010-07-13 05:36:55
>select max(date(exam_date)) from exam
You should use select max(exam_date) from exam , Because all rows will return 2010-01-07 after you call date(exam_date) in example1.
Re:Re:date issue
Srinivas
2010-07-13 07:27:50
Hi,

Thanks, this resolved my issue.
having another issue ..

in another table of mdb , date is stored as number
Ex: 39672.442373

i am using following query to convert number to date
select date(max(acq_time)) from exam

its giving only date but not time.

Can you please advice?

Thanks,
Srinivas
Re:Re:Re:date issue
HXTT Support
2010-07-13 07:56:45
>select date(max(acq_time)) from exam
>its giving only date but not time.
select timestamp(max(acq_time)) from exam
Re:Re:Re:Re:date issue
srinivas
2010-07-13 08:18:33
Thank you

the following query
select timestamp(max(acq_time)) from exam

gives below output...

for the value 39672.442373 it gives timestamp as 2008-08-13 00:00:00.0
for the value 39673.442373 it gives timestamp as 2008-08-14 00:00:00.0

we are seeing all zeroes for time in above.
Are these accurate values or do we need to manipulate them.

Thanks,
Srinivas

Re:Re:Re:Re:Re:date issue
HXTT Support
2010-07-13 19:22:46
>Are these accurate values or do we need to manipulate them.
Checked. The older package will round and get a Date type. You can try
select timestamp(max(acq_time)*86400000- 2209161600000) from exam

Re:Re:Re:Re:Re:Re:date issue
srinivas
2010-07-13 22:31:45
thank you.
this works , it returns date time as 2008-08-13 23:49:01.027 for value 39673.992373

can we have this converted to 2008-08-13 11:49:01 PM


Re:Re:Re:Re:Re:Re:Re:date issue
HXTT Support
2010-07-13 22:40:20
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss a"); //sdf.setTimeZone(java.util.TimeZone.getTimeZone("GMT")); System.out.println(sdf.format(ts));

Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Refund | Sitemap