convert from msaccess to sql2005
SELECT Format(DTrans.DATE,'dd/mmm/yyyy') AS dated, DTrans.trntype as Expr1 , DTrans.JVNO, 'By ' & FINNACCO.ACCNAME , (select analscode from INCEXPAN where analscode=val(DTrans.CRANALSCODE) and accode=craccode) AS CRANALSCODE, '' , DTrans.AMOUNT, dtrans.craCCODE AS accode, DTrans.jID,'','',dtrans.narration,dtrans.status FROM DTrans INNER JOIN FINNACCO ON DTrans.dRACCODE = FINNACCO.ACCODE order by DTrans.DATE

Software/Hardware used:
software
ASKED: December 22, 2009  6:59 AM
UPDATED: December 23, 2009  6:25 PM

Answer Wiki:
You could use the <a href="http://msdn.microsoft.com/en-us/library/ms187928.aspx">CONVERT</a> function to format dates (although it could be more efficient to do that on the front-end), and the '+' operator to concatenate strings.
Last Wiki Answer Submitted:  December 22, 2009  3:34 pm  by  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Queries as columns are very inefficient when dealing with large record sets. You may want to adjust those to being LEFT OUTER JOINs.

 64,520 pts.

 

For “val” use CAST or CONVERT also.

 1,610 pts.