MSDN
Incidentally, there's no need to use CStr in conjunction with Format: the Format function returns a string, so CStr (Format ( [Pedidos]. [Data], "yyyymmdd")) AS ...