probleum in running group clause query in vb 6.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • veer
    New Member
    • Jul 2007
    • 198

    probleum in running group clause query in vb 6.0

    Hi
    i run this query it works fine

    Select Yp1VOp,count(*) as instrec into instrec from " & txttablename & " where Yp1EOp=Yp1VOp Group By Yp1EOp,Yp1Vop Order By Yp1EOp,Yp1VOp

    but when i put a column name Yp1EOp = " " it produce the error the qeury like this

    Select Yp1VOp,count(*) as instrec into instrec from " & txttablename & " where Yp1EOp=Yp1VOp OR Yp1EOp = " " Group By Yp1EOp,Yp1Vop Order By Yp1EOp,Yp1VOp

    but i want Yp1EOp column must be empty and when i check this query in Immediate window in vb 6.0 the query looks like
    Select Yp1VOp,count(*) as instrec into instrec from Master where Yp1EOp=Yp1VOp or Yp1EOp= " Group By Yp1EOp,Yp1Vop Order By Yp1EOp,Yp1VOp
    it is changing the Yp1EOp = " " column into Yp1EOp= "
    please give some idea so that it will not change column format

    with best regards
    varinder
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    try to use this querey in VB

    "Select Yp1VOp,count(*) as instrec into instrec from " & txttablename & " where Yp1EOp=Yp1VOp OR Yp1EOp =" & "''" & "Group By Yp1EOp,Yp1Vop Order By Yp1EOp,Yp1VOp"

    Comment

    • veer
      New Member
      • Jul 2007
      • 198

      #3
      Hi
      Thanks very much
      it is working
      with best regards
      varinder



      Originally posted by debasisdas
      try to use this querey in VB

      "Select Yp1VOp,count(*) as instrec into instrec from " & txttablename & " where Yp1EOp=Yp1VOp OR Yp1EOp =" & "''" & "Group By Yp1EOp,Yp1Vop Order By Yp1EOp,Yp1VOp"

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        You are most welcome.

        Comment

        Working...