Between Date Range in a QUERY Not Working - sql

I have a Date for Example a Departure Date of a Flight for 15/01/2014 and I want to create a query that remind me 30 days before departure.
I tried the following in the CRITERIA but none of them work
DateAdd("m",1,[DepartureDate])>=Date()
Between DateAdd("m",1,[DepartureDate]) And [DepartureDate]
IIF(DateAdd("m",1,[DepartureDate]) < Date(), True, False)

You posted this quite a while ago, so I presume you managed to solve it. But if not, here is an answer for you.
There are two ways to do this.
Option One
The easiest way is to enter this in the CRITERIA of your DepartureDate field:
=Date()+30
Option Two
Alternatively, you could create a new column in your query that you filter on. To do this in your query, enter this in the FIELD row for a new column:
30DaysAway: IIf([DepartureDate]-30=Date(),"yes","no")
This will give you a new column in the query titled "30DaysAway". In that column it will say "yes" if the departure date is 30 days away from today, and "no" for all other dates.
Then in the CRITERIA for that query field, enter "yes".
Either of these options will filter the list of results and only show you entries with a departure date that is 30 days away.

Related

Need NetSuite search formula to display employee time records by projects (in rows) and day of week (in columns)

I'm trying to create a NetSuite Time search that emulates the chart style display on an employee's weekly time record, with projects listed in rows and days of the week listed in columns, with totals by day and by project. The goal is to have a search auto filtered by "Last Week" that can be used with a drop down selector filter for employees. I know there are better ways, but this is a very specific demand from someone above who believes the NS time record is a "query" and wants it to act like one.
I'm good with NS searches but know almost next to nothing about coding. I tried some basic sum formulas using CASE WHEN but am having 2 issues:
1) Can't figure out how to get CASE WHEN to sort by the weekday output from DAY of the {date} and subsequently total the hours.
2) Not sure how to total hh:mm formatted time in searches, and can't figure out what the system name of the "Duration (Decimal)" field is.
Just need one line of a sum formula to total time data from one day of the week, and a way to solve the hh:mm issue and I am good to go from there.
CASE WHEN to_char({date}, 'D') LIKE 1 THEN {durationdecimal} ELSE 0 END
SUN = 1, MON = 2, etc.

SSRS Null Date Multi-Filtering

I have a table with three columns: Task, Assigned To and Due Date. I want to set a filter to Due Date where every date is greater than or equal to today's date. I can't post any photos, but the filter is easy enough to understand. The filter looks like this:
Due_Date >=Today()
My problem is I want to include null or blank dates, and I'm finding this to be tricky by using SSRS filters.
How can I include all dates greater than or equal to today's date or null values?
Just add an OR with your other conditions (NULL or Blank):
=IIF(FIELDS!Due_Date.VALUE >=Today OR ISNOTHING(FIELDS!Due_Date.VALUE) OR FIELDS!Due_Date.VALUE = "", True, False)

Microsoft Access - Between two date range with 1 user input

I want my query to ask the user for 1 date and use that same date to create a between date condition in my query. I manage to get the date to be used in the query, but I can't seem to be able to add +6 days to it.
Field
dateRecorded
Condition
Between [Enter start date(mm/dd/yyyy)(Monday)] And [dateRecorded]+6
I don't want the user to enter 2 dates to filter by.
If you enter more than one parameter with the same request string it will only ask once and use the same input:
Between [Enter an integer] And [Enter an integer]+6
However I don't think this will work with dates; I know it does with integers etc.
I also agree with comments in question that it is better to use a form for such things to get more control; validation of correct dates such as ensuring the date entered is a Monday.

displaying records with a date at least one day greater then or = to today

I have a field in a table called DATEF. It displays dates as follows: 2013-11-25 08:30:00.000. The field is used to show appointment dates. What I need to show are future appointment dates from today or = to today. (Getdate) for some reason this is not working for me today. Appreciate the help. Thank you.
Try this... you're probably failing to factor in the time component. (This is for SQL Server, you'll have to find the equivalent for your respective environment)
SELECT <SOMETHING>
FROM TABLE
WHERE DATEF >= CONVERT(DATE,GETDATE())

record count based on current date (Today's date)

I have a form in which I enter a record and I have a field that automatically updates with the current date. I would like to add a subform that tells me how many records have been entered "today" based on current date (today's date). I would like it to keep a running total. I am new to asking questions in this format and appreciate any help and understanding.
For Access:
SELECT COUNT(*) FROM ... WHERE add_date BETWEEN DATE() AND DATE()+1;
as suggested by David W. Fenton in the comments.