报告访问查询错误

本文关键字:错误 查询 访问 报告 | 更新日期: 2023-09-27 17:55:04

嗨,我有一个查询在MS访问,它在我的。mdb文件中工作,它正在运行并返回一些数据,但当我使用teleerik报告时,我把我的查询放在里面,但它一直给我这个错误:

提供程序无法确定字符串值。例如,行已经创建,String列的默认值不可用,并且消费者没有设置新的String值。

下面是查询:

SELECT tbCie.ID AS IDCompagnie,
tbCie.Nom AS NomEtablissement,
tbCie.Telephone AS TelephoneEtablissement,
tbQVCSection.Description AS NomQuestionnaire,
"(" & tbPatient.Id & ") " & tbPatient.Prenom + " " & tbPatient.Nom AS NomPatient,
tbLogos.Image,
IIF(IIF(IsNull(tbCie.Adresse1), "", tbCie.Adresse1) <> "", tbCie.Adresse1 & Chr(10), "") & IIF(IIF(IsNull(tbCie.Adresse2), "", tbCie.Adresse2) <> "", tbCie.Adresse2 & Chr(10), "") &
IIF(IIF(IsNull(tbCie.Province), "", tbCie.Province) <> "", IIF(IIF(IsNull(tbCie.Ville), "", tbCie.Ville) <> "", tbCie.Ville & ", " & tbCie.Province & Chr(10), tbCie.Province & Chr(10)), IIF(IIF(IsNull(tbCie.Ville), "", tbCie.Ville) <> "", tbCie.Ville + Chr(10), "")) &
IIF(IIF(IsNull(tbCie.CodePostal), "", tbCie.CodePostal) <> "", tbCie.CodePostal & Chr(10), "") &
IIF(IIF(IsNull(tbCie.Telephone), "", tbCie.Telephone) <> "", tbCie.Telephone, "") AS AdresseComplete,
IIF(IsNull(tbPatient_QVCEntete.DateModification), DateValue(CStr(tbPatient_QVCEntete.DateCreation)) & " " & TimeValue(CStr(tbPatient_QVCEntete.DateCreation)), DateValue(CStr(tbPatient_QVCEntete.DateModification)) & " " & TimeValue(CStr(tbPatient_QVCEntete.DateModification))) As DateEnregistrement,
DateValue(CStr(tbPatient.DateNaissance)) & " " & TimeValue(CStr(tbPatient.DateNaissance)) AS DateNaissance,
DateDiff("yyyy", tbPatient.DateNaissance, Date()) AS Age,
IIF(IsNull(tbPatient.Poids), "", tbPatient.Poids & " KG") As Poids,
IIF(IsNull(tbPatient.Taille), "", tbPatient.Taille & " CM") As Taille,
tbPatient.NoAssuranceMaladie,
tbPatient.DateExpiration,
IIF(tbPatient.SexeMasculin = -1, "Masculin", IIF(tbPatient.SexeFeminin = -1, "Féminin", "")) As Sexe,
IIF(IIF(IsNull(tbPatient.NomEtablissement), "", tbPatient.NomEtablissement) <> "", tbPatient.NomEtablissement & Chr(10), "") &
IIF(IIF(IsNull(tbPatient.Adresse1), "", tbPatient.Adresse1) <> "", IIF(IIF(IsNull(tbPatient.NoApp), "", tbPatient.NoApp) <> "", tbPatient.NoApp & "-" &
    tbPatient.Adresse1, tbPatient.Adresse1) & Chr(10), "") &
IIF(IIF(IsNull(tbPatient.Adresse2), "", tbPatient.Adresse2) <> "", tbPatient.Adresse2 & Chr(10), "") &
IIF(IIF(IsNull(tbPatient.Province), "", tbPatient.Province) <> "", IIF(IIF(IsNull(tbVilleIso.Ville), "", tbVilleIso.Ville) <> "", tbVilleIso.Ville & ", " &
        tbProvinceIso.Province & Chr(10), tbProvinceIso.Province & Chr(10)),
    IIF(IIF(IsNull(tbCie.Ville), "", tbCie.Ville) <> "", tbVilleIso.Ville & Chr(10), "")) &
IIF(IIF(IsNull(tbPatient.CodePostal), "", tbPatient.CodePostal) <> "", tbPatient.CodePostal & Chr(10), "") AS AdressePatientComplete,

IIF(
    IIF(
        IsNull(tbPatient.TelephoneDomicile), "", tbPatient.TelephoneDomicile) <> "",
    "Téléphone Domicile: " & tbPatient.TelephoneDomicile, "" &

    IIF(
        IIF(
            IsNull(tbPatient.NoPosteTelephoneMaison), "0", tbPatient.NoPosteTelephoneMaison) <> "0",
        " poste: " & tbPatient.NoPosteTelephoneMaison,
        ""
    )
) & Chr(10) &
IIF(
    IIF(
        IsNull(tbPatient.TelephonePortable), "", tbPatient.TelephonePortable) <> "",
    "Téléphone Portable: " & tbPatient.TelephonePortable & Chr(10),
    ""
) As TelephoneComplet,IIF(ISNULL(tbPatient_QVCDestination.Ville), IIF(IsNull(tbPatient_QVCDestination.Pays), "", tbPatient_QVCDestination.Pays), IIF(IsNull(tbPatient_QVCDestination.Pays), tbPatient_QVCDestination.Ville, tbPatient_QVCDestination.Ville & ", " & tbPatient_QVCDestination.Pays)) As Destination,
IIF(ISNULL(Duree), "", Duree) As DureeVoyage,
IIF(ISNULL(sDateDepart), "", sDateDepart) As DateDepart FROM(((((tbCie LEFT JOIN tbLogos ON tbCie.IDLogo = tbLogos.IDLogo) INNER JOIN((tbPatient INNER JOIN tbPatient_QVCEntete ON tbPatient.ID = tbPatient_QVCEntete.IDPatient) INNER JOIN tbQVCSection ON tbPatient_QVCEntete.IDSection = tbQVCSection.ID)
  ON tbCie.ID = tbPatient_QVCEntete.IDCompagnie) LEFT JOIN tbPatient_QVCDestination ON tbPatient_QVCEntete.ID = tbPatient_QVCDestination.IDQVCEntete) LEFT JOIN tbPaysISO ON(tbPatient.PaysISOChar3 = tbPaysISO.PaysISOChar3 AND tbPaysISO.Langue = "3084")) LEFT JOIN tbProvinceISO ON(tbPatient.ProvinceISOChar = tbProvinceISO.ProvinceISOChar AND tbProvinceISO.Langue = "3084")) LEFT JOIN tbVilleISO ON(tbPatient.IdVille = tbVilleISO.ID AND tbVilleISO.Langue = "3084") WHERE (tbPatient_QVCEntete.ID = 37 )

报告访问查询错误

我发现问题了。这是因为一些列返回#错误,但访问仍然返回行,但在我的报告中,它给我的消息没有解释…谢谢你的关心