简体   繁体   中英

Crystal Report SQL Query command paramter with formula editor value

I'm using crystal report builder and I need to pass to the SQL Server a query with date limitation by Crystal Report parameters.

My SQL table store the datetime as bigint (UTC TICKS).

The user send the parameter for the report selection by calendar selection tool so the received parameter is datetime for the crystal report.

Ho can I perform a query in SQL Command (Crystal Report - command) after changing the parameter value/type? Can I use a formula to change the parameter before using it in the command?

For example: ShiftDateTime({@CreationTime},"UTC,0", "")

Thanks!

I found the answer:

bigint to date: select dateadd(minute ,cast((8123371500/60) as bigint),cast('1753-01-01' as datetime))

date to bigint : select cast(DateDiff(minute,'1753-01-01','2010-06-03 12:05:33') as bigint)*60

thanks anyway.

Shai.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM