473,703 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using COUNT FUN and CAST

50 New Member
SQL Value:
Expand|Select|Wrap|Line Numbers
  1. "COUNT(tbl__UserLog._UserLog_ID) AS Count_Logins "
  2.  
Returns as varchar which is killing me, because my user interaction is loaded w/ sort features. Unfortunately the count_logins var getting posted to the script is an integer.
So I recieve :
Syntax error converting the varchar value 'Count_Logins' to a column of data type int.
When the post var gets compared to the AS Count_Logins var (in a Dynamic WHERE clause)....
If I convert the post var to a string - it returns no results?!?!

I have tried unsuccessfully to use CAST to convert the type w/ in the sql statement.

I don't even understand why the heck COUNT(tbl__User Log._UserLog_ID ) AS Count_Logins is not an INT by default!?!?

Any advice is so appreciated as I have researched/experimented now for hours unsuccessfully and need to go home like 1.5 hours ago.


thanks 2 you.
Nov 10 '06 #1
0 1451

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

Similar topics

10
3005
by: Jozef de Veuster | last post by:
Hi, I'm trying to create a Stored Procedure that returns a recordset, but I want to be able to choose the ORDER BY clause in mijn parameter list of the Stored Procedure. Since CASE .. WHEN can only be used in the SELECT clause, I came up with the following: -- BEGIN SCRIPT -- DECLARE @blah AS VARCHAR(20) SET @blah = 'DOSSIER_CODE'
30
6081
by: junky_fellow | last post by:
I was looking at the source code of linux or open BSD. What I found that lots of typedefs were used. For example, consider the offset in a file. It was declared as off_t offset; and off_t is typedefed as typedef long off_t; I wanted to know what advantage do we get by typedefs ? Why we did not declare
5
3868
by: lancer6238 | last post by:
Dear all, I'm trying to implement the Smith-Waterman algorithm for DNA sequence alignment. I'm aligning a 2040 bp query sequence against a 5040 bp sequence. I'll be trying to implement a parallel version of it later, that's why I have the MPI timer function to measure the speedup. seq and foundseq0 are the query sequence. size is the length of the sequences. The problem seems to occur when I'm trying to increase the memory
5
3876
by: Edwin | last post by:
I am trying to write an application among which one of the functions is to determine the number of unique extensions found in a directory and all of its sub directories. I am trying to use Linq to XML to do this. Below is the code being used to accomplish what I am trying to do. In the "if" statement, I am trying to update the <Count></CountElement to "TESTING". However what I will really want is to add 1 to the existing numerical...
5
5314
by: Edwin | last post by:
I am trying to write an application among which one of the functions is to determine the number of unique extensions found in a directory and all of its sub directories. I am trying to use Linq to XML to do this. Below is the code being used to accomplish what I am trying to do. In the "if" statement, I am trying to update the <Count></CountElement to "TESTING". However what I will really want is to add 1 to the existing numerical...
0
8659
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
9239
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
9102
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...
0
8951
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...
0
7844
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5920
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2424
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2055
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.