Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
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
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT DBF
date issue
Srinivas
2010-07-13 05:03:39.0
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.0
>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.0
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.0
>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.0
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.0
>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.0
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.0
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
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap