At 06:47 PM 6/30/2016, asgkuschinsky wrote:

I am trying to set up a Where clause that searches a Date column (MM/DD/YY)
but I only want to search based off of the month.

For example, I want to search all dates in January regardless of the day
or year.

I've tried several variations, both based on what I know and what I found
online, but I either get a syntax error or a date value error...Any thoughts?


Here's how ...

01. Find the INTEGER MONTH of a given date using the (IMON(DATE)) function

02. Then, use that value to search using the WHERE (IMON(datecolumn)) = value

-- A very simple example

   SET VAR vDate DATE = 06/30/2016
   SET VAR vMonth INTEGER = (IMON(.vDate))
   BROWSE * FROM tablename WHERE (IMON(datecolumnname)) = .vMonth

   That should return all rows with datecolumnname with that month regardless
   of date or year.

-- Example 02
-- For January
   BROWSE * FROM tablename WHERE (IMON(datecolumnname)) = 1
-- For February
   BROWSE * FROM tablename WHERE (IMON(datecolumnname)) = 2
-- For June
   BROWSE * FROM tablename WHERE (IMON(datecolumnname)) = 6
-- For December
   BROWSE * FROM tablename WHERE (IMON(datecolumnname)) = 12

Hope that provides you with a technique to accomplish your goal.

Very Best R:egards,

Razzak.



--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to