I have a problem where the Approved value (SQL) has a 1,0 or NULL value. I can not figure out how to show the null value when returned for the filtered input. -
<cfset vApproved = 0>
-
<cfif isDefined("form.cboApproved")>
-
<cfif form.cboApproved eq "">
-
<cfset vApproved = 0>
-
<cfelse>
-
<cfset vApproved = #form.cboApproved#>
-
</cfif>
-
<cfelse>
-
<cfset vApproved = 0>
-
</cfif>
-
-
<td>
-
<select name="cboApproved" class="smallFont">
-
<!---<option value="All">All</option>--->
-
<option value="1"
-
<cfif isDefined("vApproved")>
-
<cfif vApproved eq 1>
-
selected
-
</cfif>
-
</cfif>
-
>True</option>
-
<option value="0"
-
<cfif isDefined("vApproved")>
-
<cfif vApproved eq 0>
-
selected
-
</cfif>
-
</cfif>
-
>False</option>
-
<option value= "">Need Approval</option>
-
</select>
-
</td>
-
Query pulling the information below. -
<cfquery name="qRecords" datasource="VarRenum_Spaisdata3">
-
SELECT
-
-
[VR_Machine_Name] as ActivityType
-
,[Activity]
-
-
,[VR_Department_Number]
-
,[FullName]
-
-
,[Approved]
-
,[ApprovedBy]
-
,[ApprovedDate]
-
-
,[Login_Status]
-
,[Login_Date]
-
,[TotalTime]
-
-
,[VR_Machine_Participant_Activity_Login_ID]
-
,[VR_Machine_Participant_Activity_ID]
-
,[VR_Activity_ID]
-
,[VR_Participant_ID]
-
,[VR_Machine_Participant_ID]
-
,[VR_Machine_ID]
-
-
,[TeamMember_Activity]
-
,[Last_LogInOrOut]
-
,[Logout_Date]
-
,[Inactive]
-
,[InactiveDate]
-
,[InactivatedBy]
-
,[RecCreatedBy]
-
,[RecCreatedDate]
-
,[RecUpdatedBy]
-
,[RecUpdatedDate]
-
,[Method]
-
,[Manning_Factor]
-
,[Approval_Required]
-
,[Batch_Approval_Allowed]
-
,[Batch_LogoutByBUL]
-
,Department
-
,BusinessUnit
-
,Crew
-
,Value_Nvarchar
-
FROM [VariableRemuneration].[dbo].[vw_web_Machine_Participant_Activity_Logins] ma
-
WHERE
-
ma.Approved = '#variables.vApproved#' and
-
ISNULL(ma.Approval_Required,0) = '#variables.vApprovalRequired#'
-
and ma.BusinessUnit like '#variables.vBusUnit#'
-
<!---AND Login_Date Between '#vBeginDate#' AND '#vEndDate#'--->
-
<!---AND Login_Status = '#vLoginStatus#'--->
-
<!---AND ma.Login_Status = 'In'--->
-
ORDER BY ma.Login_Date
-
</cfquery>
-
2 3109
I need some help getting syntax on an issue. I have a listbox with 3 values, True(1), False(0) and Needs Approval(NULL) but I can't seem to get the NULL to show. The SQL column has this as a bit value so a Case adjustment does not work.
What I need this to do is if the Needs Approval value is selected in the cboApproved box then use the 'qRecordsNull" query to get the results, else use the "qRecords" query.
Below is the code that I have that works for true and false. Any help would be greatly appreciated. - <cfset vApproved = 0>
-
<cfif isDefined("form.cboApproved")>
-
<cfif form.cboApproved eq "">
-
<cfset vApproved = 0>
-
<cfelse>
-
<cfset vApproved = #form.cboApproved#>
-
</cfif>
-
<cfelse>
-
<cfset vApproved = 0>
-
</cfif>
- <td>
-
<select name="cboApproved" class="smallFont">
-
<!---<option value="All">All</option>--->
-
<option value="1"
-
<cfif isDefined("vApproved")>
-
<cfif vApproved eq 1>
-
selected
-
</cfif>
-
</cfif>
-
>True</option>
-
<option value="0"
-
<cfif isDefined("vApproved")>
-
<cfif vApproved eq 0>
-
selected
-
</cfif>
-
</cfif>
-
>False</option>
-
<option value= "">Need Approval</option>
-
</select>
-
</td>
You could have it as -1 and then check for that within the output of the select element to show the selected option.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: John Morgan |
last post by:
In an SQL statement which concatenates several fields I get a null
value returned if any one of the fields are null.
Is this to be expected?
For example :
SELECT tblMember.memberAddress + '...
|
by: Denzil |
last post by:
Hi,
I am retrieving my DB values and setting them in the
MyRS::DoFieldExchange(CFieldExchange* pFX) function. One of these
records is a Long datatype and could be "Null" in the DB table.
The...
|
by: Robb Gilmore |
last post by:
Hello,
We have a C#.NET app which is calling a Java webservice. We use the wsdl
file exportted from the java webservice to create our web-reference in Visual
Studio. We are able to create the...
|
by: Robert |
last post by:
I need to be able to send a null value into a Sql Server datetime field. The
follolwing code is a snippet of what I am using. I am parsing a flat file
from the main frame and inserting it into a...
|
by: TC |
last post by:
What does it mean for an integer to have a null value? I am trying to use
the DataView.Find method. That method has an integer return type which
contains the "index of the row in the DataView...
|
by: hardieca |
last post by:
Hi,
My formview or gridview control stops updating or deleting a record
once the record has a null value.
I have table tblTest with the following
pkID int NOT NULL **IDENTITY COLUMN**...
|
by: benjen |
last post by:
Hi all,
XP, office 2003 Pro, MS access. Fairly newby.
I'd like to run simple calculations on multiple and specific colums like avg and sd. The problem is that the empty cells cause the ...
|
by: vikas251074 |
last post by:
When the page loads default date is displayed in both date field.
Can I set null value in expected return date just after selecting 'NR' Not returnable in list? Is there any idea?
...
|
by: axapta |
last post by:
Hi Group,
How can I overcome the issue of null values in a datareader. I keep getting
the dbnull error when I try to assign a null value to a text box.
TIA
|
by: meridianPhone |
last post by:
Microsoft Access 2007
No forms are involved.
I am trying to enforce referential integrity between two tables, but only if there is a non-null value in one of the foreign fields of a compound...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |