Microsoft
Software
Hardware
Network
Question : syntax error converting datetime from character string
I am getting the error syntax error converting datetime from character string. I believe I need to use cast but cannot get the syntax correct. I could use some help
SELECT
tbl_CHC_PPO_VFR.PPO_VFR_KE
Y,
tbl_CHC_PPO_VFR.CBH_Vendor
_Name,
tbl_CHC_PPO_VFR.Vendor,
tbl_CHC_PPO_VFR.FileType,
Year([Cycle_Date]) & CASE WHEN Len(Month([Cycle_Date]))=1
THEN '0' & Month([Cycle_Date]) ELSE Month([Cycle_Date]) END AS CHCCyclePeriod,
tbl_CHC_PPO_VFR.Account_Nu
mber,
tbl_CHC_PPO_VFR.Branch_Num
ber,
tbl_CHC_PPO_VFR.Ben_Opt,
CASE WHEN [Eft_Date] Is Null THEN 'blank' ELSE [Eft_Date] END AS EftDate,
'blank' AS CoveragePeriod,
'blank' AS State_Abr,
tbl_CHC_PPO_VFR.Product,
Tbl_CHC_Products.Line_Of_B
usiness AS LOB,
tbl_CHC_PPO_VFR.Dollar_Amt
,
tbl_CHC_PPO_VFR.Pending,
CASE WHEN [Alliance_Ind] Is Null THEN 'blank' ELSE [Alliance_Ind] END AS AllianceInd,
CASE WHEN [Parent_Network_ID] Is Null THEN 'blank' ELSE [Parent_Network_ID] END AS ParentNetworkID,
CASE WHEN [Mem_Network_ID] Is Null THEN 'blank' ELSE [Mem_Network_ID] END AS MemNetworkID,
CASE WHEN [Coord_Party_ID] Is Null THEN 'blank' ELSE [Coord_Party_ID] END AS CoordPartyID,
tbl_CHC_PPO_VFR.File_Date,
CASE WHEN [ManualAdjustment] Is Null THEN 'No'ELSE [ManualAdjustment] END AS ManualAdjust,
tbl_CHC_PPO_VFR.Adjustment
Note,
oapr_tbl_VFR_Payment_Perio
d_Conversi
on.Payment
Period,
tbl_CHC_PPO_VFR.ClaimRefun
d,
oapr_tbl_VFR_Payment_Perio
d_Conversi
on.PendFil
e
FROM ((oapr_tbl_VFR_Payment_Per
iod_Conver
sion
INNER JOIN tbl_CHC_PPO_VFR
ON oapr_tbl_VFR_Payment_Perio
d_Conversi
on.File_Da
te = tbl_CHC_PPO_VFR.File_Date)
INNER JOIN oapr_tbl_Current_Period
ON oapr_tbl_VFR_Payment_Perio
d_Conversi
on.Payment
Period = oapr_tbl_Current_Period.Cu
rrentPerio
d)
INNER JOIN Tbl_CHC_Products
ON tbl_CHC_PPO_VFR.Product = Tbl_CHC_Products.Product_C
d
WHERE (((tbl_CHC_PPO_VFR.Pending
)='Y')
AND ((tbl_CHC_PPO_VFR.ClaimRef
und)='No')
AND ((oapr_tbl_VFR_Payment_Per
iod_Conver
sion.PendF
ile)='Pend
File'));
Answer : syntax error converting datetime from character string
are there any null values in that field?
Random Solutions
SBS 2008 How to Change the Company web Page Calender Date Format
Sysprep service pack 3
3 long beeps
Event ID 37 Microsoft-Windows-Kernel-P
rocessor-P
ower
Unable to Search Empty Folders
Need solution to convert Java 1.6 application into C# project
Blackberry not activinating on BES
Check colum A for names in the name matches a sheet name in any workbook then copy to the sheet where we are quering from.
Code in SQL 2000 not parsing/running in SQL 2005 Query Analyzer
MS CRM Duplicate Detection rule not working