Kapalı

I need a Postgresql Query

Job Description:

SELECT

CASE WHEN

multi_app_documentation.nsma1_code = 'DATE' THEN TO_DATE(multi_app_documentation.nsma1_ans, 'MMDDYYYY') END AS "Procedure Date",

' ' AS "Case Confirmation Number",

ip_visit_1.ipv1_firstname AS "Patient First",

ip_visit_1.ipv1_lastname AS "Patient Last",

visit.visit_sex AS "Patient Gender",

TO_CHAR(visit.visit_date_of_birth, 'MMDDYYYY') AS "DOB",

visit.visit_id AS "Account Number",

visit.visit_mr_num AS "MRN",

' ' AS "Module",

' ' AS "Signed off DT",

CASE WHEN

multi_app_documentation.nsma1_code = 'CRNA' THEN multi_app_documentation.nsma1_ans END AS "Primary CRNA",

' ' AS "Secondary CRNA",

' ' AS "Primary Anesthesiologist",

' ' AS "Secondary Anesthesiologist",

' ' AS "Canceled Yes/No"

FROM

multi_app_documentation

INNER JOIN ip_visit_1 ON multi_app_documentation.nsma1_patnum = ip_visit_1.ipv1_num

INNER JOIN visit ON ip_visit_1.ipv1_num = visit.visit_id

WHERE

multi_app_documentation.nsma1_code = 'DATE' AND TO_DATE(multi_app_documentation.nsma1_ans, 'YYYYMMDD') = CURRENT_DATE

ORDER BY

ip_visit_1.ipv1_lastname;

The problem is that the multi_app_documentation.nsma1_ans field is VARCHAR. The information is entered as 01/23/2023 or 01232023 or 1/23/23 or 2/09/2023 or 2/9/2023. Because of this it is generating errors when I try to convert the string to date in the SELECT statement and in the WHERE statement.

> ERROR: invalid value "12/1" for "YYYY"

DETAIL: Field requires 4 characters, but only 2 could be parsed.

HINT: If your source string is not fixed-width, try using the "FM" modifier.

> Time: 3.587s

Beceriler: PostgreSQL, PostgreSQL Programming

Müşteri Hakkında:
( 0 değerlendirme ) Pratt, United States

Proje NO: #35820432

Bu iş için 11 freelancer ortalamada $112 teklif veriyor

nhdangit

Hi I am very good for MySQL, MongoDB and PostgreSQL, and Database management System So I can work with your project perfectly Please discuss with me start work I am ready for you Thank you!

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(1 Yorum)
2.2
masterblockchain

Hello Happy new year! I am a full stack web/mobile and blockchain developer. I am sure I can handle this project sucessfully. I can start now. Regards

$140 USD in 7 gün içinde
(0 Değerlendirme)
0.0
yevhenrosovskii

Hello, there! How are you! I am a sql expert. I've read your explanation carefully. I'm confident with your project. I can work right now. Please contact to me. Looking forward to hearing from you. Thank you.

$140 USD in 7 gün içinde
(0 Değerlendirme)
0.0
herefforyou

GOOD IN SOFTWARE ARCHITECTURE GOOD IN CODING HELLO DEAR CLIENT Thank you for sharing your project requirement, I have carefully read the project description and I would like to take part in this project. I will work a Daha Fazla

$140 USD in 7 gün içinde
(0 Değerlendirme)
0.0
vimpalshah

I can help to fix the error of your query. I can prepare query as per your requirement. I am c# .net programmer having 14+ years of experience in developing and handling different type of applications. I believe in qu Daha Fazla

$120 USD in 7 gün içinde
(0 Değerlendirme)
0.0
julynguyen322

========= PostgreSQL ========= Hi, dear client! I am happy to tell you about my skills I have read your requirement and I noticed that I am appropriate to this project. I have rich experiences with website development Daha Fazla

$100 USD in 3 gün içinde
(0 Değerlendirme)
0.0
mannnupatel

I have more than 14 years of IT experience with various database technologies. Working Knowledge of Oralce,postgres Databases. Strong experience in Oracle to postgres migration Strong Oralce Development Skills working Daha Fazla

$140 USD in 7 gün içinde
(0 Değerlendirme)
0.0
pedroarnedo

I am a Computer Engineer, I am certified as an ethical hacker by ECCouncil and I have a Master's in Computer Security. I have more than 15 years of professional experience in this area. I also have 27 years of experien Daha Fazla

$110 USD in 7 gün içinde
(0 Değerlendirme)
0.0
Yogidhan1988

I have gone through your errors and ready to fix that.. i have a 12 years of experience in this field.

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0