asd = "SELECT [db].[dbo].[eldb1].[ab_id] AS [ab_id_izm], [db].[dbo].[pen].[DATA_OPL],[db].[dbo].[pen].[SUMA], '1' AS [RAZNOST], '0' AS [SHT_UPL], '1' AS [SVEDENIA], [db].[dbo].[pen].[ID_IZM], '1' AS [BLOK], '1' AS R, [db].[dbo].[pen].[IDENERGY] AS [OTST] " & _
" FROM [db].[dbo].[eldb1] INNER JOIN [db].[dbo].[pen]ON [db].[dbo].[eldb1].[nomer_sch1] = [db].[dbo].[pen].[nomer_sch1] " & _
" WHERE [db].[dbo].[pen].[DATA_OPL] Between '" & Format(DateValue(appopen.fdate.Text), "MM-dd-yyyy") & "' and '" & Format(DateValue(appopen.ldate.Text), "MM-dd-yyyy") & "' and " & "[db].[dbo].[pen].[IDENERGY] = '" & enid & "'and [db].[dbo].[eldb1].[nomer_sch4] = '" & encod & "' ORDER BY [db].[dbo].[pen].[ID_IZM] DESC;"
|