Link to home
Start Free TrialLog in
Avatar of route217
route217Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Where is the varchar statement .... in the following SQL Code

Hi Experts

Where is the varchar statement in the following code.....



SELECT 

snapshot_date,
contact_part_id,
contact_id,
case_status,
primary_flag,
void_flag,
demand_type,
created_datetime,
CAST([created_dateonly] AS DATETIME) AS [created_dateonly],
part_type,
product_01,
product_02,
product_03,
product_04,
cal_days_part_to_cr,
cal_days_part_to_log,
bus_days_part_to_cr,
bus_days_part_to_log,
hour_part_created,
multi_issues_percentage,
part_redress_honouring_product,
part_redress_writeoff,
part_redress_01_distress_and_inconvenience,
part_redress_03_customer_expenses,
part_redress_09_operational_loss,
cal_days_parts_outstanding_dib,
bus_days_parts_outstanding_dib,
cal_days_parts_outstanding_dicr,
bus_days_parts_outstanding_dicr,
cal_days_parts_outstanding_created,
bus_days_parts_outstanding_created,
cal_days_parts_e2e,
bus_days_parts_e2e,
acc_email,
ad,
add_if_differs,
advisor_name_initials,
advisor_name_surname,
advisor_name_title,
advisor_staff_id,
advisor_uk,
asap,
attitude_to_risk,
cause_where_01,
cause_where_02,
cause_where_03,
cause_where_04,
clc,
colleague,
complaint_area_1_01,
complaint_area_1_02,
complaint_area_2_01,
complaint_area_2_02,
complaint_area_3_01,
complaint_area_3_02,
complaint_details,
complexity,
consultant,
contact_method,
crf_amended,
CAST([date_outcome_dateonly] AS DATETIME) AS [date_outcome_dateonly],
pull_01_datetime,
pull_03_datetime,
date3_datetime,
date_closed_cpov_datetime,
date_closed_fsa_cp_datetime,
date_comp_pull_01_datetime,
date_comp_pull_02_datetime,
date_comp_pull_03_datetime,
date_comp_pull_04_datetime,
CAST([date_defect_dis_dateonly] AS DATETIME) AS [date_defect_dis_dateonly],
date_flagged_rl_datetime,
date_moved_in_datetime,
CAST([date_of_sale_dateonly] AS DATETIME) AS [date_of_sale_dateonly],
CAST([date_of_survey_datetonly] AS DATETIME) AS [date_of_survey_datetonly],
date_req_datetime,
date_stage1_datetime,
dfii,
dfir,
dfiu,
dpm,
dt_in_crcp_datetime,
ees_client,
eligibility,
error_no,
explanation,
face2face,
feedback_provided,
CAST([final_dateonly] AS DATETIME) AS [final_dateonly],
final_dl,
fpoc

FROM  tbl_TB

Open in new window

SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of route217

ASKER

keep on getting an error....saying:

the conversion of a varchar data type to a a datetime date type resulted in an out-of-range value.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks & Cheers, Paul

btw: I will make a tiny change to heading: "i sthe" to "is the".