473,750 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

probleum in running group clause query in vb 6.0

198 New Member
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
Apr 17 '08 #1
3 1494
debasisdas
8,127 Recognized Expert Expert
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"
Apr 17 '08 #2
veer
198 New Member
Hi
Thanks very much
it is working
with best regards
varinder



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"
Apr 17 '08 #3
debasisdas
8,127 Recognized Expert Expert
You are most welcome.
Apr 17 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
17373
by: Robby McGehee | last post by:
I need this to work: SELECT FROM WITH (NOLOCK) where ='a' GROUP BY , HAVING COUNT () > 1 The problem is that I get an error that needs to be in the GROUP BY clause or aggregate function. if I put it in there, I will get no duplicates (because it is the identity field). The whole point of this is to find dups. Thanks for any help.
2
3090
by: Paxton | last post by:
Hi, I'm trying to display the total page views per page within a given date range, but the correct SQL is seemingly beyond me. I get the correct result with a straightforward Group By and Count clause eg SELECT DISTINCT tblPageViews.PageVisited, Count(tblPageViews.PageVisited) AS CountOfPageVisited FROM tblPageViews GROUP BY tblPageViews.PageVisited;
2
2362
by: aj70000 | last post by:
This is my query select ano,max(date),a_subject from MY_TAB where table_name='xyz' and ano=877 group by a_subject,ano order by a_subject ANO max(Date) A_Subject 877 2005-01-20 00:00:00.000 Subject_1 877 1900-01-01 00:00:00.000 Subject_2 877 2004-12-20 00:00:00.000 Subject_3
2
5986
by: JJA | last post by:
Please advise on how to get the GROUP BY coded in an acceptable way: DECLARE @LO INT DECLARE @HI INT DECLARE @StartDate varchar(10) DECLARE @EndDate varchar(10) SELECT @StartDate = '01/01/2005' SELECT @EndDate = '06/30/2005' SELECT @LO = 250
8
4118
by: Tony Williams | last post by:
I have a database that hold s figures for each quarter. I want to create a query whereby the user can ask for the running total of the data upto the quarter they enter into a prompt. The database stores the quarter name in txtmonthlabel (a date field) and the quarters totals in txtdomic (a number field) EG If the user enters March 2004 they get figures upto March 2004, if they enter June 2004 they get total upto June 2004, in other words...
12
25294
by: Bill Moran | last post by:
Hey all. I've hit an SQL problem that I'm a bit mystified by. I have two different questions regarding this problem: why? and how do I work around it? The following query: SELECT GCP.id, GCP.Name FROM Gov_Capital_Project GCP,
2
2118
by: Lorenzo Thurman | last post by:
I'm using PHP 5 to make an ODBC connection to an MS Access database using PEAR and I'm getting DB Error: Syntax Error when using the GROUP BY clause. Here's my query: SELECT * FROM HardwareInstallationsSummary WHERE LocationID = $loc_ID GROUP BY EquipmentTypeID Just for kicks, I changed the GROUP BY to ORDER BY. The query works, and the items are sorted as expected, but this is not what I want. Is there a bug in here somewhere? TIA
2
1070
by: progvar | last post by:
Hi! i have a query and i want to print the value of this query by programing. I use this query in ms-access and works fine but when i execute this query in visual basic it does't produce any error but no value is printed. Please provide the help Set dbMn = Workspaces(0).OpenDatabase(txtpath) Set RSmn = dbMn.OpenRecordset("SELECT UDAC, count(*) AS RCOUNT from " & txttable & " GROUP BY UDAC ORDER BY UDAC") txtpth =...
6
12172
by: MM | last post by:
Hello users. I have a query that I can run and see the result on the grid on design time, but when i run the program i get the folowing message:ORA-00979: not a GROUP BY expression. When I run the same query with out parameters it runs and it was runing well before in Oracle 8.Also If I don't use the GROUP BY function but with the parameter, it works also well ?What is the problem? The query is:select t1.id,t2.nad,max(t2.name) as namefrom...
0
8836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9575
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9394
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9338
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6803
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2223
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.