Something looks wrong with the first element of your boolean expression argument to WHERE. What is "b.1" supposed to represent?
In any case WHERE is used with strings all the time. Here is an example that demonstrates using it with precisely formatted date strings like yours:
IDL> seed = 1L ; Make a pseudorandom set of dates
IDL> randomDaysIn2007 = julday(1,1,2007) + fix(randomu(seed, 16) * 365)
IDL> ; Store them as strings in precise MM-DD-YYYY format
IDL> myDates = string(randomDaysIn2007, FORMAT='(C(CMoI02, "-", CDI02, "-", CYI4))') IDL> print, myDates, FORMAT='(4A12)' ; Here are our 16 data elements
; 06-01-2007 02-03-2007 10-04-2007 07-13-2007
; 12-06-2007 05-20-2007 08-27-2007 01-25-2007
; 09-21-2007 09-02-2007 05-20-2007 08-19-2007
; 11-19-2007 07-09-2007 08-26-2007 03-28-2007
IDL> print, where(myDates eq '03-28-2007')
15
IDL> ; I can even search for substrings. Here I am looking for dates with the 19th day
IDL> print, where(strmid(myDates, 3, 2) eq '19')
; 11 12
James Jones
|