تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
تحويل Function من Vb الى sql server
#1
السلام عليكم ورحمة الله وبركاتة :

هذه الفاينكشن تم عملها بال vb واريد تحويلها الى Function داخل Sql server
ليتم استدعائها من داخل الاستعلام

كود :
Public Function sh(NuKind As Integer, Independent As Integer, Ser As Integer, Trav As Integer, HousValDult As Currency, HospValDult As Currency, _
BusTicValDult As Currency, VisaVal As Currency, SpecialDisc As Currency, FligTicValDult As Currency, _
           HousValChlid As Currency, HospValChlid As Currency, BusTicValChlid As Currency, FligTicValChlid As Currency, _
                   HousValBaby As Currency, HospValBaby As Currency, BusTicValBaby As Currency, FligTicValBaby As Currency)
               Dim Shiv
If Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValDult, 0) + Nz(HospValDult, 0) + Nz(BusTicValDult, 0) + Nz(VisaVal, 0))
   ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValDult, 0) + Nz(HospValDult, 0) + Nz(FligTicValDult, 0) + Nz(VisaVal, 0))
     ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValDult, 0) + Nz(HospValDult, 0) + Nz(FligTicValDult, 0) + Nz(VisaVal, 0))
 
   
   ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValDult, 0) + Nz(HospValDult, 0) + Nz(BusTicValDult, 0))
   ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValDult, 0) + Nz(HospValDult, 0) + Nz(FligTicValDult, 0))
    ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValDult, 0) + Nz(HospValDult, 0) + Nz(FligTicValDult, 0))
 
   
   ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValDult, 0) + Nz(BusTicValDult, 0))
   ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValDult, 0) + Nz(FligTicValDult, 0))
    ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValDult, 0) + Nz(FligTicValDult, 0))
 
   
   ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 1 Then
       Shiv = Nz(BusTicValDult, 0)
   ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 2 Then
       Shiv = Nz(FligTicValDult, 0)
       ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 3 Then
       Shiv = Nz(FligTicValDult, 0)

   
   ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(BusTicValDult, 0) + Nz(VisaVal, 0))
   ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(FligTicValDult, 0) + Nz(VisaVal, 0))
     ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(FligTicValDult, 0) + Nz(VisaVal, 0))
 
   
         ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HospValDult, 0) + Nz(BusTicValDult, 0) + Nz(VisaVal, 0))

    ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HospValDult, 0) + Nz(FligTicValDult, 0) + Nz(VisaVal, 0))
   
        ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HospValDult, 0) + Nz(FligTicValDult, 0) + Nz(VisaVal, 0))

   
    ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HospValDult, 0) + Nz(BusTicValDult, 0))

    ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HospValDult, 0) + Nz(FligTicValDult, 0))
   
        ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HospValDult, 0) + Nz(FligTicValDult, 0))

   
   
   
   
   
   ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 8 Then
       Shiv = (Nz(HousValDult, 0) + Nz(HospValDult, 0) + Nz(VisaVal, 0))
   ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 9 Then
       Shiv = (Nz(HousValDult, 0) + Nz(HospValDult, 0))
   ElseIf Nz(NuKind, 0) = 1 And Nz(Ser, 0) = 10 Then
       Shiv = Nz(HousValDult, 0)
   
   
   
   
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValChlid, 0) + Nz(HospValChlid, 0) + Nz(BusTicValChlid, 0) + Nz(VisaVal, 0))
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValChlid, 0) + Nz(HospValChlid, 0) + Nz(FligTicValChlid, 0) + Nz(VisaVal, 0))
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValChlid, 0) + Nz(HospValChlid, 0) + Nz(FligTicValChlid, 0) + Nz(VisaVal, 0))
   

   
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValChlid, 0) + Nz(HospValChlid, 0) + Nz(BusTicValChlid, 0))
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValChlid, 0) + Nz(HospValChlid, 0) + Nz(FligTicValChlid, 0))
    ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValChlid, 0) + Nz(HospValChlid, 0) + Nz(FligTicValChlid, 0))
 
   
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValChlid, 0) + Nz(BusTicValChlid, 0))
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValChlid, 0) + Nz(FligTicValChlid, 0))
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValChlid, 0) + Nz(FligTicValChlid, 0))
   
   
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 1 Then
       Shiv = Nz(BusTicValChlid, 0)
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 2 Then
       Shiv = Nz(FligTicValChlid, 0)
    ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 3 Then
       Shiv = Nz(FligTicValChlid, 0)
 
   
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(BusTicValChlid, 0) + Nz(VisaVal, 0))
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(FligTicValChlid, 0) + Nz(VisaVal, 0))
    ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(FligTicValChlid, 0) + Nz(VisaVal, 0))
   
     
         ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HospValChlid, 0) + Nz(BusTicValChlid, 0) + Nz(VisaVal, 0))

    ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HospValChlid, 0) + Nz(FligTicValChlid, 0) + Nz(VisaVal, 0))
   
        ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HospValChlid, 0) + Nz(FligTicValChlid, 0) + Nz(VisaVal, 0))

   
    ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HospValChlid, 0) + Nz(BusTicValChlid, 0))

    ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HospValChlid, 0) + Nz(FligTicValChlid, 0))
   
        ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HospValChlid, 0) + Nz(FligTicValChlid, 0))

   
   
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 8 Then
       Shiv = (Nz(HousValChlid, 0) + Nz(HospValChlid, 0) + Nz(VisaVal, 0))
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 9 Then
       Shiv = (Nz(HousValChlid, 0) + Nz(HospValChlid, 0))
   ElseIf Nz(NuKind, 0) = 2 And Nz(Ser, 0) = 10 Then
       Shiv = Nz(HousValChlid, 0)

ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(BusTicValBaby, 0) + Nz(VisaVal, 0))
   
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
'?
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
 
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(BusTicValBaby, 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0))
 
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(BusTicValBaby, 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(FligTicValBaby, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(FligTicValBaby, 0))
 
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 1 Then
       Shiv = Nz(BusTicValBaby, 0)
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 2 Then
       Shiv = Nz(FligTicValBaby, 0)
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 3 Then
       Shiv = Nz(FligTicValBaby, 0)
   
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(BusTicValBaby, 0) + Nz(VisaVal, 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
 
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(BusTicValBaby, 0) + Nz(VisaVal, 0))

    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
   
        ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))

   
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(BusTicValBaby, 0))

    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0))
   
        ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0))

   
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 8 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(VisaVal, 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 9 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 1 And Nz(Ser, 0) = 10 Then
       Shiv = Nz(HousValBaby, 0)

   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(BusTicValBaby, 0) + Nz(VisaVal, 0))
   
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))

   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
 
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(BusTicValBaby, 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0))
 
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(BusTicValBaby, 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(FligTicValBaby, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(FligTicValBaby, 0))
 
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 1 Then
       Shiv = Nz(BusTicValBaby, 0)
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 2 Then
       Shiv = Nz(FligTicValBaby, 0)
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 3 Then
       Shiv = Nz(FligTicValBaby, 0)
   
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(BusTicValBaby, 0) + Nz(VisaVal, 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
 
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(BusTicValBaby, 0) + Nz(VisaVal, 0))

    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
   
        ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))

   
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(BusTicValBaby, 0))

    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0))
   
        ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0))
   
   
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 8 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(VisaVal, 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 9 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 2 And Nz(Ser, 0) = 10 Then
       Shiv = Nz(HousValBaby, 0)

   
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(BusTicValBaby, 0) + Nz(VisaVal, 0))
   
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))

   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
 
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(BusTicValBaby, 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(FligTicValBaby, 0))
 
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(BusTicValBaby, 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(FligTicValBaby, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(FligTicValBaby, 0))
 
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 1 Then
       Shiv = Nz(BusTicValBaby, 0)
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 2 Then
       Shiv = Nz(FligTicValBaby, 0)
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 3 Then
       Shiv = Nz(FligTicValBaby, 0)
   
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(BusTicValBaby, 0) + Nz(VisaVal, 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
 
     
             ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(BusTicValBaby, 0) + Nz(VisaVal, 0))

    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
   
        ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))

   
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(BusTicValBaby, 0))

    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0))
   
        ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0))

   
   
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 8 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(VisaVal, 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 9 Then
       Shiv = (Nz(HousValBaby, 0) + Nz(Nz(HospValBaby, 0), 0))
   ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 3 And Nz(Ser, 0) = 10 Then

     ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 1 Then
           Shiv = Nz(VisaVal, 0) + Nz(Nz(HospValBaby, 0), 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 2 Then
      Shiv = Nz(FligTicValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(VisaVal, 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 1 And Nz(Trav, 0) = 3 Then
      Shiv = Nz(FligTicValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(VisaVal, 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 2 Then
       Shiv = Nz(FligTicValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(VisaVal, 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 3 Then
       Shiv = Nz(FligTicValBaby, 0) + Nz(Nz(HospValBaby, 0), 0) + Nz(VisaVal, 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 1 Then
       Shiv = Nz(HospValBaby, 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 2 Then
       Shiv = Nz(FligTicValBaby, 0) + Nz(Nz(HospValBaby, 0), 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 2 And Nz(Trav, 0) = 3 Then
       Shiv = Nz(FligTicValBaby, 0) + Nz(Nz(HospValBaby, 0), 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 1 Then
      Shiv = 0
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 2 Then
       Shiv = Nz(FligTicValBaby, 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 3 And Nz(Trav, 0) = 3 Then
       Shiv = Nz(FligTicValBaby, 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 1 Then
       Shiv = 0
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 2 Then
       Shiv = Nz(FligTicValBaby, 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 4 And Nz(Trav, 0) = 3 Then
       Shiv = Nz(FligTicValBaby, 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 1 Then
       Shiv = Nz(VisaVal, 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 2 Then
       Shiv = Nz(FligTicValBaby, 0) + Nz(VisaVal, 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 5 And Nz(Trav, 0) = 3 Then
       Shiv = Nz(FligTicValBaby, 0) + Nz(VisaVal, 0)


ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(VisaVal, 0))

    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))
   
        ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 6 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0) + Nz(VisaVal, 0))

   
    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 1 Then
       Shiv = (Nz(HospValBaby, 0))

    ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 2 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0))
   
        ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 7 And Nz(Trav, 0) = 3 Then
       Shiv = (Nz(HospValBaby, 0) + Nz(FligTicValBaby, 0))




ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 8 Then
       Shiv = Nz(VisaVal, 0) + Nz(Nz(HospValBaby, 0), 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 9 Then
       Shiv = Nz(HospValBaby, 0)
ElseIf Nz(NuKind, 0) = 3 And Nz(Independent, 0) = 4 And Nz(Ser, 0) = 10 Then
       Shiv = 0
ElseIf Nz(NuKind, 0) Then
       Shiv = 0
 
   
   
   
'==========================================================================================
   Else
       Shiv = ""
End If
    On Error Resume Next
 
sh = Shiv - Nz(SpecialDisc, 0)
End Function
الرد
تم الشكر بواسطة:
#2
والمطلوب يا سهران؟ تبي حد يحولها لك؟!
يعني انت ما حاولتش معاها ابدا؟

الرد
تم الشكر بواسطة:
#3
أخي الكريم
انا كل شغلي سابقا على قواعد بيانات اكسس مباشرة
وجديد على قواعد بيانات sql server
حاولت كم محاوله وفشلت
نعم اخي الكريم محتاج حد يحولها
الرد
تم الشكر بواسطة:
#4
أخي الكريم

هذا الكتاب مبسط لتعلم Sql Server



أتمنى لك وللجميع التوفيقق


الملفات المرفقة
.pdf   خالد السعداني SQL.pdf (الحجم : 2.53 م ب / التحميلات : 2)
الرد
تم الشكر بواسطة:
#5
شكر لك اخي الكريم على هذ الهدية القيمة
واحتاج الى من يساعد في تحويل الفاينكشن
الرد
تم الشكر بواسطة:
#6
ما تفعل هذه الفنكشن
الرد
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  استرجاع قاعده بيانات sql server من هاردسك اخر Rabeea Qbaha 0 121 08-11-18, 09:34 PM
آخر رد: Rabeea Qbaha
  مشكلة في عمل كود فورم بالاكسس بعد الاتباط بقاعدة بيانات SQl SERVER alsihran 4 141 01-11-18, 11:46 PM
آخر رد: alsihran
  اذا ممكن مساعدة في تحويل معادلة في اكسل الى كود sql server sharawee707 10 394 24-10-18, 06:52 PM
آخر رد: sharawee707
  مفاتيح العلاقة بين جدولين بال Sql server عبد العزيز البسكري 7 183 27-09-18, 02:45 AM
آخر رد: elgokr
  [سؤال] كيف اغير اسم قاعدة البيانات للبرنامج من داخل SQL Server ابوثامر الحربي 1 314 14-09-18, 02:52 PM
آخر رد: abo.saad
  ابسط طريقة لحل مشكلة ظهور الحروف العربية على شكل علامات استفهام في SQL Server sendbad100 3 593 01-08-18, 03:27 PM
آخر رد: محمد كريّم
  [سؤال] فتح المرفقات عن طريق sql server محمد القدسي 3 189 02-07-18, 02:31 AM
آخر رد: elgokr
  [SQL] فيديو بسيط يوضح اساسيت التعامل مه sql server tarek 1 295 03-05-18, 10:36 AM
آخر رد: gergis
  كيف أستطيع معرفة اسم الـ server Itachi 2 3,787 14-02-18, 04:12 PM
آخر رد: altho8
  [SQL] الدخول الى sql server بواسطة public ip هالة سعد 3 493 31-12-17, 02:30 AM
آخر رد: وائل القطاوي

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم