>
lparameters tc2File, tnShift
>if type("tnShift") # "N"
> tnShift = 0
>endif
>lcFrom1 = getfile("DBF","Info dosyasi ?")
>lcFrom2 = getfile("DBF","Velocity dosyasi ?")
>select ;
> dtot(a.date_b) + ;
> int(a.tb)*3600 + ;
> ((a.tb - int(a.tb)) * 100 * 60 ) ;
> AS tDT, ;
> B.Vel ;
> from (lcFrom1) a, (lcFrom2) b ;
> where a.cm_code = b.cm_CODE ;
> into table (tc2File)
>replace all tdt with ( tdt+(recno()-1)*3600 ) + tnShift
>
>Run the code and browsed the tables proudly again showing them all data now had tnShift mins shift and could be joined easily. I forgot one
little point. VFP stores datetime as real values not as YYYYMMDD... as in date type :( When I did the SQL (which I thought a child could do too) I got
0 records !
>
>Only moving "+ tnShift" into SQL corrected the problem (before "as tdt").
>Cetin
Actually, datetime() stores the date as integer Julian date (first 4 bytes) and milliseconds after midnight (other 4 bytes), though in operation it treats them as seconds. So you should be adding 3600 to what was already in there, or whatever other process you use to get around this - even if it includes replacing all datetimes with ctot(ttoc(datetimefield)), which would round it to whole seconds. Actually, there are a thousand different datetimes which have the same ttoc() representation...