Show only records that have NO text in database

Last Reply on Feb 28, 2013 04:07 AM By Mustafa

Posted on Feb 25, 2013 05:16 AM

HI

this is BEHCODE Table in database

Id

Behcode

Reserve

date

1

1000

NO

 

2

1001

YES

2012-12-12

3

1002

YES

2012-12-13

4

1003

YES

2012-12-15

5

1004

NO

 

6

1005

YES

2012-12-17

7

1006

NO

 

8

1007

NO

 

9

1008

NO

 

 

in ADMIN.aspx page I define datalist and I want in dataLIst show data of BEHCODE column

I want in dataLIst  show behcode that in reserve column's data is ='NO' but I want it show behcode wuth reserve='NO' that are before MAXDATE in DATE column

E.g

in this table I want show these behcode

1000 -1004

these behcode have reserve='NO' and these are behcode that are before 1005 that have MAX datein this table

here I don't want show these behcode 1006-1007-1008

becuse these behcode are after 1005  that have MAxDate

 

BEST REGARDS

 

 

Posted on Feb 28, 2013 04:07 AM

Ok you will need to write this query

SELECT Behcode FROM Behcode WHERE Date = (SELECT MAX(Date) FROM Behcode WHERE Behcode BETWEEN 1000 AND 1005 AND Reserved = 'No')

and check whether it works

I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html