Re: Get timestamp when using xbar

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo}span.s1 {font-variant-ligatures: no-common-ligatures}

operate on the timestamp directly instead of casting it:

select avg price by 10*1000000000 xbar time from t

Also note that value is a kdb+ keyword and can cause issues as a column name, better to rename it. 

+1 on not using keywords :-)

Prateek appears to be using datetime rather than timestamp type.

select avg val by  (1%8640) xbar time from t
watch out for grouping/keys on types which use an underlying floating point (e.g. datetime).

Timestamp type is represented by a 64bit int, achieve the same with
select avg val by 0D00:00:10 xbar timestamp from t

Thanks Charles and Jamie. 

 (1%8640) works for me. I guess its datetime. datatype is “Z”.

Thanks for the suggestion of not using keywords 

Thanks - D