• Top Members
    Reps
    Posts
  • 834 Replies
    2585 Replies
  • 713 Replies
    2021 Replies
  • 331 Replies
    1928 Replies
The site is still being updated (as of 14th Jan 2018 6PM GMT) but can be used in the meantime.

Looking if DB Records Don't contains any?

Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Locked
User avatar
Dummy1912
VIP - Donator
Posts: 1947

Looking if DB Records Don't contains any?

Thu Aug 24, 2017 5:56 pm

Hello,

Can someone give me an example for
when looking from a DB Table Ledger
and see if no records from Ledger contains a value 'False'
i just need to check from Ledger table 1 value only not the other values that contains 'True or False'

i use Sqlite ;)

Thanks

User avatar
Dummy1912
VIP - Donator
Posts: 1947

Re: Looking if DB Records Don't contains any?

Thu Aug 24, 2017 8:53 pm

Jikes that was a good thinking lol

i did this and works :nersmile

what coffee do sometimes

Code: Select all

                        If SearchSubmitted("False", .mMonthID, .mYearID) Then
                            .Notes = ""
                        Else
                            .Notes = "Submitted"
                        End If


    Public Function SearchSubmitted(ByVal Value As String, ByVal monthid As Integer, ByVal yearid As Integer) As Boolean
        'WHERE SALARY LIKE '200%'
        Try
            Dim whereClause As String = "monthid ='" & monthid & "' AND yearid ='" & yearid & "' AND status LIKE '" & Value & "%'"
            Dim count As Integer = Convert.ToInt32(DataBase.ExecuteScalar("SELECT count(*) FROM transactions WHERE " & whereClause & " ;"))

            If count = 0 Then
                MyFunctions.IsSubmitted = True
                Return False
            Else
                MyFunctions.IsSubmitted = False
                Return True
                Exit Function
            End If
            Return True
        Catch ex As Exception
            MyFunctions.IsSubmitted = False
            Return False
            Exit Function
        End Try
    End Function


User avatar
CodenStuff
Site Admin
Posts: 4348

Re: Looking if DB Records Don't contains any?

Fri Aug 25, 2017 4:15 pm

Sorry I wasn't around to help answer your question.

However, I do like it when you find the solution yourself. It shows that you're learning new things on your own and your knowledge of coding is getting better and better. Well done.

The code-force is with you :)
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.

Locked

Return to “Tutorial Requests”