473,412 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Search on combination of two columns - tricky one

Hi All

I have an ASP page where I am building a query to get the data from the
table. I am using Microsoft Access and ASP

The table has three columns Id, StartDate, EndDate.

For each record the users only enter either the startdate or enddate and not
both.

When i am writing my querystring I want to sort my results by date but the
date should be a combination of StartDate, EndDate

I tried something like this

SELECT * FROM Table ORDER BY NZ(StartDate,EndDate)

This works in the database directly but on the ASP page it does not allow
the NZ expression.

Can any one help please?
Aug 15 '06 #1
1 1372
JP SIngh wrote:
Hi All

I have an ASP page where I am building a query to get the data from
the table. I am using Microsoft Access and ASP

The table has three columns Id, StartDate, EndDate.

For each record the users only enter either the startdate or enddate
and not both.

When i am writing my querystring I want to sort my results by date
but the date should be a combination of StartDate, EndDate

I tried something like this

SELECT * FROM Table ORDER BY NZ(StartDate,EndDate)

This works in the database directly but on the ASP page it does not
allow the NZ expression.

Can any one help please?
You have to use the IIF function instead:

ORDER BY iif(IsNull(StartDate),EndDate,StartDate)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Aug 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: todd | last post by:
here is a search tool SP I wrote. How many times have you wanted to search all your Stored procs or views (in a database) for a keyword but couldn't!? Well now you can! THis can makes life a...
5
by: JP SIngh | last post by:
Hi All This is a complicated one, not for the faint hearted :) :) :) Please help if you can how to achieve this search. We have a freetext search entry box to allow users to search the...
3
by: sanniep | last post by:
Hello, I've got a table containing customerspecific records (names, adresses, ID's, etc). I want to search this table using a form with a choicelist on it. This choicelist displays several columns...
9
by: paragpdoke | last post by:
Hello All. I'm looking for some algorithm to build a combination of strings from multiple arrays. Let me explain in detail. - I'm working on VBA (excel). I have functions that accept one string...
20
by: sophia | last post by:
Dear all, The following is the program which i have done to find all the combination of letters in the string "hello" #include<stdio.h> #include<stdlib.h> #include<string.h> #define MAX 5
8
by: Sham | last post by:
I am trying to perform the following query on a table that has been indexed using Full Text Search. The table contains multiple columns than have been indexed. (Below, all xml columns are...
0
by: KevLe | last post by:
I'm building a log search function in c# for a certain management app and would like some help on the design how to solve this, here is my solution (on paper) so far: The log files are saved to...
0
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
6
by: ilikebirds | last post by:
I once again come before you all to request assistance. I have a lengthy String of Data Of which I would like to create new Columns for. Example: = "1, Bob, Brown, 58, Argyle, Big Jacket" ...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
0
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...
0
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...

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.