Index datetime

74 views
Skip to first unread message

Itamar M. Lins Jr. Lins

unread,
Aug 20, 2013, 8:40:22 AM8/20/13
to harbou...@googlegroups.com
Hi!
How to index datetime ?
For example:
field date = datetime

index on xyz for dtos(date) >= "20130701"
show only date with empty(hour)

what should I use ?
hb_ttos() not show.
hb_stot() not show.
dtos() not show.

Best regards,
Itamar M. Lins Jr.

marek.h...@interia.pl

unread,
Aug 20, 2013, 9:35:12 AM8/20/13
to harbou...@googlegroups.com

Od: "Itamar M. Lins Jr. Lins" <itama...@gmail.com>
Do: harbou...@googlegroups.com;



Wysłane: 14:40 Wtorek 2013-08-20
Temat: [harbour-users] Index datetime

Hi


index on xyz for dtos(date) >= "20130701"
show only date with empty(hour)

Why not 

index on xyz for date >= stod( "20130701")

can you try ?

Regards,
Marek Horodyski


Itamar M. Lins Jr. Lins

unread,
Aug 20, 2013, 9:50:14 AM8/20/13
to harbou...@googlegroups.com
Hi!
Show 0 records :(
Not is possible to manipulate field datetime ?
Because not work.
I use for field type date
dBegin := dEnd := date()

Index on xyz for dtos(date) >= dtos(dBegin) .and. dtos(date) <= dtos(dEnd)
Works fine!

But with field datetime not work :(
Show only field with TIME 00:00:00.000

Best regards,
Itamar M. Lins Jr.

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
 
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

G3...@aol.com

unread,
Aug 20, 2013, 9:58:53 AM8/20/13
to harbou...@googlegroups.com
Hi Itamar
 
The following line of code works for me:
 
INDEX ON Dtos(qso_date)+qso_start+serno_out TO &indx1
 
The first parameter is a date, the second the time in text format and the third a serial number in text format.
 
Regards

Bob

Bob F Burns G3OOU
C Eng, FIET, MSE
G-QRP 6907
Secretary of Crystal Palace Radio & Electronics Club: www.g3oou.co.uk
Technical web site: www.qsl.net/g3oou
@BobFBurns on Twitter: http://twitter.com/BobFBurns

Itamar M. Lins Jr. Lins

unread,
Aug 20, 2013, 10:28:49 AM8/20/13
to harbou...@googlegroups.com
Yes I understand, but I found some problem in dbf here.
The field was of type date and was converted to datetime, I am trying to isolate the problem.

Perhaps harbour not accept datime only with date while run convertion.

Best regards,
Itamar M. Lins Jr.




2013/8/20 <G3...@aol.com>

--

Kevin Carmody

unread,
Aug 20, 2013, 2:03:50 PM8/20/13
to harbou...@googlegroups.com
Itamar,

Did you try HB_TTOS()?  This converts a type "T" field (usually called timestamp or time) to an index string, much as DTOS() converts a date field to an index string.

Kevin

Itamar M. Lins Jr. Lins

unread,
Aug 20, 2013, 3:07:05 PM8/20/13
to harbou...@googlegroups.com
Hi!
I found the problem here.
My fault.
Guru Przmek unlocked the mystery :)
I edit via hbrun same fields datetime  without activating the "set century on"

hbrun.exe was saving datetime 2013 -> 1913 :-(

Best regards,
Itamar M. Lins Jr.


2013/8/20 Kevin Carmody <i...@kevincarmody.com>
Reply all
Reply to author
Forward
0 new messages