How to convert axapta date to sql datetime in query
CurExt() is a method to get current company. you can sql query in axapta and you can convert date to datetime in query as mention above/
str sqlstr;
sqlstr = "SELECT * FROM LedgerJournalTrans WHERE DATAAREAID=‘ "
+ curExt() + "‘ " + " AND CreatedDate<CAST(‘ "
+ date2str(str2date(’22/02/2006′,123),321,2,3,2,3,4)
+ " ‘ AS datetime) "
+ " AND CreatedDate> CAST(‘ " + date2str(str2date’20/02/2006′,123),321,2,3,2,3,4)
+ " ‘ AS datetime) ";
CurExt() is a method to get current company. you can sql query in axapta and you can convert date to datetime in query as mention above/