Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
  Buy Now
  HXTT Excel v6.1
  HXTT Json v1.0
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
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)

date issue
2010-07-13 05:03:39
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.

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
2010-07-13 07:27:50

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?

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
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.


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
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


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