Empty field in DB

Results 1 to 2 of 2

Thread: Empty field in DB

  1. #1
    Join Date
    Dec 1969

    Default Empty field in DB

    I am trying to check if a field is 0 or 1. The field I am getting data from has no data in it. I thought this meant the field was null. What do I test the value (or lack of value) against to make the following "if" statement work? I want the value to be 0 if nothing is in the field.<BR><BR><BR><BR>CONST ADDEDIT_VALUE = &H00000001 <BR>CONST DELETE_VALUE = &H00000002 <BR>CONST STATUS_VALUE = &H00000004 <BR>CONST FULL_VALUE = &H78888888 <BR><BR>strSes_file_Perm = buildBinaryNum(RS("user_p_AddEdit"),RS("user_p_Del ete"),RS("user_p_Status"),RS("user_p_Full"))<BR><B R>Function buildBinaryNum(AddEdit, Delete, Status, Full)<BR> Dim total <BR> total = 0<BR> total = total + addToBinary(AddEdit, ADDEDIT_VALUE)<BR> total = total + addToBinary(Delete, DELETE_VALUE)<BR> total = total + addToBinary(Status, STATUS_VALUE)<BR> total = total + addToBinary(Full, FULL_VALUE)<BR> buildBinaryNum = total<BR>End Function<BR><BR>Function addToBinary(perm, value)<BR> response.write("***" & perm & "***")<BR> If perm = 0 OR perm = NULL Then<BR> value = 0<BR> End If<BR> response.write("^^^" & value & " " & "<BR>")<BR> addToBinary = value<BR>End Function<BR><BR>results:<BR>******^^^1 <BR>******^^^2 <BR>******^^^4 <BR>***1***^^^2022213768 <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Empty field in DB

    I think this is what you&#039;re looking for<BR><BR>If perm = 0 OR IsNull(Perm) Then <BR> value = 0 <BR> End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts