oracle datediff months. 999 is to not use the between comparison and instead use column_name >= @StartDate and column_name < @EndDate +1. oracle datediff months

 
999 is to not use the between comparison and instead use column_name >= @StartDate and column_name < @EndDate +1oracle datediff months  You don't need to generate all the days as it'll be inefficient; just use a recursive sub-query factoring clause to iterate over each month: WITH months (

For example, from 2/10 to 3/10 is considered one month, and from 2/10 to 3/15 is also considered one month. SQL> select 24 * (to_date ('2009-07-07 22:00', 'YYYY-MM-DD hh24:mi') - to_date ('2009-07-07 19:30', 'YYYY-MM-DD hh24:mi')) diff_hours from dual; DIFF_HOURS ---------- 2. Modified 7 years, 2 months ago. Improve this answer. Then Oracle will not use an index on the date_column and would need a separate function-based index on either TRUNC(date_column) or TO_CHAR(date_column, 'DD-MM-YYYY'). You also wouldn't prefix a function name with the @ sign. The Days, Months, and Years parameters can be negative or positive. Date. I tried going off of something like this: Select records from SQL Server if greater than 6 months but I get the error: Subquery returned more than 1 value. So subtracting a TIMESTAMP WITH TIME ZONE that is 5 am Eastern from a TIMESTAMP WITH TIME ZONE that is 2 am Pacific will result in an interval of 0. Admission_Date) > 5. TZD is a time zone designator ( Z, + / - hh: mm or + / - hhmm ). Connect and share knowledge within a single location that is structured and easy to search. Here is the synopsis: If using Oracle use the trunc and numtoyminterval functions; if using SQL Server use the datediff function. date. PRINT DATEDIFF(Day, 2010-02-20, 2010-01-01) RETURN 20SELECT DATEDIFF (MM,0,GETDATE ()) Add same number of month to date 0 (1901/01/01) SELECT DATEADD (MM, DATEDIFF (MM,0,GETDATE ()),0) Then we will get first day of current month (Current Date or a given date) To get Last Day of Last Month. SQL Server has a nice function called DateDiff which takes a date part, startdate and enddate. Concatenates a date to a time on either side of the + symbol and returns a TIMESTAMP or TIMESTAMPTZ. SELECT DATEADD ( year, DATEDIFF ( year, 0, GETDATE ()), 0 ) 這個 SQL 的技巧是先取得和 1900-01-01 - 也就是上面的 0 的意思,SQL Server 中的第零天 - 差幾年 (從 DATEDIFF 得到一個整數),再用 DATEADD 加 0 來將整數再轉成日期的型態。. 在本文中,我们介绍了oracle数据库中的datediff函数。通过指定日期部分、开始日期和结束日期,我们可以使用datediff函数计算两个日期之间的差异。这对于计算日期之间的天数、小时数、分钟数等非常有用。希望本文对您理解datediff函数的使用有所帮助。 MySQL DATEDIFF: Calculating weeks, months, or years between two dates. In SQL, we can add or subtract days, months, or years to a date by using the DATEADD function. add_months (date,n) Returns the date that corresponds to date plus the number of months indicated by the integer n . The datepart value cannot be specified in a variable, nor as a quoted string like 'month'. select DATEADD(MONTH,1350,0) will give 2012-07-01 00:00:00. We will be using the same employees table in order to demonstrate the intricacies of calculating the difference between two dates in terms of weeks, months, or years using MySQL’s DATEDIFF() function. Oracle doesn't have a DATEDIFF() function. The months_between function returns the elapsed months going from the second date to the first. The difference between 1st March 2011 and 29th February 2012 is 0. SQL date formatfunctions in SQL server are really powerful and really helps to deliver impactful data analytics and reports. 5 = 0. Functions. You can use this to fetch all the days between two dates by: Subtracting the first date from the last to get the number of days. . SQL DATEPART. Use DATEADD and DATEDIFF() function together in SQL query. Again, the expected results would be a value of 1. YEAR: Stores the year information only, either in 2-digit or 4-digit format. 2. 構文 @DATEDIFF (' difference ', ' date ', ' date ') difference. Computes the aggregate of a measure over the period starting x units of time and ending y units of time from the current time. The Oracle NEXT_DAY() function returns the date of the first weekday specified by day name that is later than a date. This works, but it is a bit clumsy compared to the sql server function:So, the weird number you see is the difference between the two dates. This is because the two dates are exactly 24 hours apart. , NextDate, DATEDIFF("D", Date, NextDate) FROM ( SELECT ID, AccountNumber, Date, ( SELECT MIN(Date) FROM YourTable T2 WHERE T2. Return the current time. 1970年1月1日から2037年12月31日までの入力日付を示す数値。. 4k 4 4 gold badges 40 40 silver badges 53 53 bronze badges. 0208 days. We would like to show you a description here but the site won’t allow us. MONTHS_BETWEEN = 1. Adds days, months, and years to the date and returns the result. 3 Answers. Also, you can check this for minutes : Oracle : how to subtract two dates and get minutes of the result. DATE_DIFF = 1. Note that SQL Server DATEDIFF(month, date2, date1) function does not return exactly the same result, and you have to use an user-defined function if you need to fully emulate the Oracle MONTHS_BETWEEN function (see. PostgreSQL. I want to find out the customers who have made orders on three successive months. Here is some T-SQL that gives you the number of years, months, and days since the day specified in @date. Example-3: List the name and surname of students whose age 17. count the number of elapsed time, taking care of daylight savings: day+1 - day = 1 = 24h (but using midnight time and daylight savings it could be 0 day and 23h)DATEDIFF(): It finds the difference between two dates passed to it. The MONTHS_BETWEEN function returns an estimate of the number of months between two arguments. Modified 1 year, 8 months ago. 16. 1. 利用日期间的加减运算. Oracle Database enables you to perform arithmetic operations on dates and time stamps in several ways: Add a numeric value to or subtract it from a date, as in SYSDATE + 7; Oracle Database treats the number as the number of days. MONTHS_BETWEEN returns number of months between dates date1 and date2. The month is created in the table from the delivery date in the format 01/mm/yyyy. The following query selects all rows with a. January 30, 2004 - 7:26 pm UTC. We are now using NHibernate to connect to different database base on where our software is installed. Few examples of DATEDIFF: DATEDIFF - Example 1 Here, in this example, datepart is "day": SELECT DATEDIFF(day,'2016-06-05','2016-08-05') AS DiffDate. DATEADD(month, DATEDIFF(month, 0, getdate())+1, 0) returns the beginning of next month. MONTHS_BETWEEN gives the number of whole months between the 2 dates, and calculates the fractional part as the remainder in days divided by 31. There are two methods to achieve this. Calculate the last date of the month is quite simple calculation -. 1. select trunc ( (sysdate - to_date ('2012-02-28 15:20', 'YYYY-MM-DD hh24:mi')) / 24) from dual; You should have multiplied by. To compare dates in SQL, the most common functions used are DATEDIFF, DATE_ADD, DATE_SUB, and NOW. subtract and give the difference in number of months. Oracle's MONTHS_BETWEEN on the other hand tries to calculate an exact difference in months' fractions: select months_between(date '2021-02-01', date '2021-01-31') from dual; => 0. Accountnumber = T1. What this allows you to do is pass in two TIMESTAMP or DATETIME values (or even DATE as MySQL will auto-convert) as well as the unit of time you want to base your difference on. (Query using SQL server 2005 and 2008 is allowed). The DATEDIFF function will return the difference count between two DateTime periods with an integer value whereas the DATEDIFF_BIG function will return its output in a big integer value. adddate addtime curdate current_date current_time current_timestamp curtime date datediff date_add date_format date_sub day dayname dayofmonth dayofweek dayofyear extract from_days hour last_day localtime localtimestamp makedate maketime. MySQL DATEDIFF: Calculating weeks, months, or years between two dates. Assuming you are asking about MySQL the below query will provide you with the remaining time required. Converting a raw number of days into a number of weeks and days is pretty simple. 1 - Find the total months count till today's date using DATEDIFF function -. Add to or subtract from a date. Modified 1 year, 8 months ago. 2903225806. CODE = 'CONTACT_CLIENT' THEN a. CASE WHEN GETDATE () = 'first of this month' THEN 'DATE column' between 'first day of last month' and 'last day of last month'. In SQL Server 2012 you can use EOMONTH (Transact-SQL) to get the last day of the month and then you can use DAY (Transact-SQL) to get the number of days in the month. declare @EmployeeStartDate datetime='01-Sep-2013' declare @EmployeeEndDate datetime='15-Nov-2013' select DateDiff (mm,@EmployeeStartDate, DateAdd (mm, 1,@EmployeeEndDate)) If. If date1 is earlier than date2 , then the result is negative. SELECT DATEADD ( quarter, DATEDIFF. And then we need to convert the output of DATEPART to a 2-digit month number. Extract a value of a date time field e. Here is the TSQL to calculate the last day of the current month. Table 9. It returns a whole month (no fraction) if both dates have the same day-of-month or both are the last day of the month. Date manipulation is a common scenario when retrieving or storing data in a Microsoft SQL Server database. This requires breaking the date into its year, month, and day parts, putting them together in "yyyy/mm/dd" format, then casting that back to a date. Move the start date to the next Monday, then add the calculated weeks. February 28 and March 31), the fractional portion is zero, even if the days of the month are not the same. Please refer the below examples and kindly let me know your ideas. To answer your question to find all records that occurred last month. In that case the real year difference is counted, not the rounded day difference. In most use cases, Snowflake correctly handles date and timestamp values formatted as strings. I see that marked final solution is not correct always. user637544 Jun 1 2009 — edited Jun 1 2009. You get the difference in days. The key is to use DATEADD and DATEDIFF along with the appropriate SQL timespan enumeration. for extended XSL functions. The two date fields are "timestamp" format (date and time). (year/month/date from date) //oracle function for extracting values from date. – nrmad. FLOOR (DATEDIFF (DAY, date_of_birth, reference_date) / 365. The DATEPART() function returns an integer which is a part of a date such as a day, month, and year. Functions that return the current date or time each are evaluated only once per query at the start of query execution. Let’s factor it in! First, we will take the person’s birthday and will use the DATEADD( ) function. Also, according to Oracle's documentation LAST_DAY returns a DATE. DATEDIFF_BIG () is a SQL function that was introduced in SQL Server 2016. DAYS function. By adding 1 month, I am calculating the first day of next month and then subtraction 3 milliseconds, which allows me to arrive at the last day of the current month. 0 days. What's the function in Oracle that would be the equivalent to DATEDIFF in the SQL Server? On Oracle, it is an arithmetic issue: Select DATE1. lastModified and w. Answer: You can use the months_between function and convert it easily yo years between and decades between two dates: months_between/12 = years between. 1. In SQL Server, there is a function datediff with datepart 'q'/quarter which behaves as follows :--. MySQLには MONTH 機能がありますが、Oracleにはありません。 存在しない関数 DATEDIFF が無効なIDであるのと 同じ理由。 ORA-00904の解決策は、 EXTRACTという名前の正しいOracle関数 を呼び出して、列の月の値を取得することです。Use DATEADD and DATEDIFF() function together in SQL query. January 30, 2004 - 7:26 pm UTC. It is a function of SQL server. In Oracle SQL, I want to display the difference between two dates in the format 'x years y months z days'. e. So I am porting many SQL Procedures to Oracle. The function INTCK ('MONTH','31jan1991'd,'1feb1991’d) returns 1, because the two dates lie in different months that are one month apart. Oracle has a months_between function: AND MONTHS_BETWEEN (sysdate, s. DATEDIFF (MONTH, DATEADD (DAY,-DAY (startDate)+1,startDate),DATEADD (DAY,-DAY (startDate)+1,endDate)) Share. For many values of the local settings, this would simply fail. Date3(year, month, day) – similar to the ‘Date’ function described above, except that the three parameters are passed in as separate year, month and day values. Hi Ive been having an issue with getting the correct difference in a date from the current month not including the day. Try SELECT SYSTIMESTAMP + INTERVAL '5' MINUTE, SYSTIMESTAMP + 5 / 24 / 60 to convince yourself. Which leads me to believe that it is treating February. When the reporting date month is the same as the target month you can get a round up To get the number of month or day, you change the first argument to month or day as shown below: Notice that the DATEDIFF () function takes the leap year into account. date_to, DATEDIFF(DD, evnt. date_from, evnt. mm is a two digits of minute (00 through 59). Suppose, InstallDate is 1st of the month (if falls on Saturday) and CompleteDate is 16th of the month (if falls on Sunday) In that case, actual Business Days is 10 but the marked query result will give the answer as 12. Share. It operates according to the rules of the Gregorian calendar. You can include Oracle hints in PeopleSoft Query expressions as long as you adhere to the following rules: Expressions containing a hint must begin with /*+ . ss is two digits of second (00 through 59). The syntax for these extended functions is. select trunc (months_between (:end_date,. 9. 005479 (1 year + 2/365 years). Returns 'Oracle Database 10g Enterprise Edition Release 10. Taking example 1, Oracle is telling me that 3rd Feb was a longer time ago than Informatica is telling me it is. I have to get the date from the system and calculate the date difference in days. INTERVAL '15. SELECT case when DATEDIFF(month, '2005-12-31' , '2006-04-01 ') > 3 then 'yes' else 'no' end Hope that helps, John. SQL> ed Wrote file afiedt. Converts one date format to a new format and returns the result. I say ALL months as months can have 28 days (29 in a leap year), 30 days and 31 days which is why I wouldn't simply calculate the days between two dates. Multiply the result of step 1 by 12 to transform it to months 3. For a baby born 28-Feb-17, properly calculated they turn 1 years old on 28-Feb-18 - their next birthday. Teams. Of course, if you need days instead of months, you can simply subtract one date from another, e. To calculate the number of days between date1 and date2, you can use either Day of. January 1 of any year defines the starting number for the week datepart, for example: DATEPART (wk, 'Jan 1, xxxx') = 1, where xxxx is any year. ReturnDate) AS nvarchar(max)) END) AS [Duration] As a side note: I used nvarchar(max) for consistency with the first part of your query. Add one date to or subtract it from another, as in l_hiredate - SYSDATE. (CASE WHEN Trips. Example. Date parts examples are day, week,. What I am using is (Today-Dob)/30/12, but this is not accurate as some months have 31 days. PostgreSQL - Date Difference in Months. In addition, with DATEDIFF () the column is an argument to the function. + (Concatenation) operator. Because the months are 06 in both dates. 1. SQL> ed Wrote file afiedt. COMPUTE days3 = CTIME. 3. Now for testing purposes I need to compare the data for the last say 4 months from the sysdate. The next example will show the differences between two dates for each specific datapart and abbreviation. DECLARE @date datetime2 = '2021-01-07 14:36:17. - Find the “date_diff” in hours and multiply it by “60”. DATE_SUB () Subtract a time value (interval) from a date. DATEDIFF accepts either. ;-). 3. Below is a syntax for the DATEDIFF () function. 65. see this sqlfiddle. 1. Using DbFunctions, accessed via EF. SELECT DATEADD (month, 1, '20220730'); The below DATEADD will add 1 year to the provided date value, the year changed from 2022 to 2023. DateDiff(“m”, Fields! starting date. But I suggest you add a computed column to the table: alter table Family add AgeYears as Year (getdate ()) - Year (dob) - 1 + case when Month (getdate ()) > month (dob) then 1 when month (getdate ()) < month (dob) then 0 else case when day (getdate ()) >= day (dob) then 1 else 0 end end. Next to calculate a month of services in a company by a user we would use ‘m’ to calculate the difference value. S is milliseconds in one or up to six digits. Add 18 years to the date in the BirthDate column, then return the date: SELECT LastName, BirthDate, DATEADD (year, 18, BirthDate) AS DateAdd FROM Employees; Try it Yourself ». Discussion: To calculate the difference between the timestamps in Oracle, simply subtract the start timestamp from the end timestamp (here: arrival - departure ). 365 days elapse between the two dates. Add a comment. It operates according to the rules of the Gregorian calendar. Next to calculate a month of services in a company by a user we would use ‘m’ to calculate the difference value. Purpose MONTHS_BETWEEN returns number of months between dates date1 and date2. 15 between 2 values that are 1 year, 1 month and 15 days apart. answered Oct 19, 2016 at 9:38. Just divide the total by 7 to get the weeks and then calculate the remaining days. For example, only one set of /*+ */ is allowed. The application passes in two parameters: a string representing the number of the desired month (i. Syntax:. g. MONTH_START_DATE > DATEADD (MONTH, -1, h. ROUND returns date rounded to the unit specified by the format model fmt. And what date you want to get for example difference between dates 456 days it's mean: 1 year 3 month and several days. day: Number - The day of the month (1-31). The second row is only 30 minutes apart, so the difference is 0. This function is not sensitive to the NLS_CALENDAR session parameter. TIMEZONE_HOUR, TIMEZONE_MINUTE, and TIMEZONE_SECOND are only allowed for TIMESTAMP WITH TIME ZONE values. DATEADD () Adds or subtracts a specified time interval from a specified date. This function adds a specified number of days, months, and years to a given date. We would like to show you a description here but the site won’t allow us. DATEPART function is used to return a part of a given date in a numeric value. Share. Sorted by: 55. Modified 2 years, 9 months ago. Thus far, we have seen very important SQL date format functions such as DATEPART, DATENAME, YEAR, MONTH, and DAY, with particular emphasis on the DATEADD SQL function and the DATEDIFF SQL function. This works because you have no issue with months and years or one-digit vs. 10 Answers. two full prior months plus the current partial month. You'll get a more accurate result if you compute the difference between the two dates in days and divide by the mean length of a calendar year in days over a 400 year span (365. This function is not sensitive to the NLS_CALENDAR session parameter. 5 Answers Sorted by: 65 I'd use months_between, possibly combined with floor: select floor (months_between (date '2012-10-10', date '2011-10-10') /12) from dual;. - Find the “date_diff” in hours and multiply it by “60”. 2425. Hot. ToDate)); My SQL to LINQ Recipe might help you with some translation issues in the future. DATEDIFF does not guarantee that the full number of the specified time units passed between 2 datetime values: -- Get difference in hours between 8:55 and 11:00 SELECT DATEDIFF (hh, '08:55', '11:00'); -- Returns 3 although only 2 hours and 5 minutes passed between times -- Get difference in months between Sep 30, 2011 and Nov 02, 2011. Weeks. SELECT DATEADD(WEEK, DATEDIFF(WEEK,0,GETDATE()),-3) Executes. Then you'll see the number. 6222691' DECLARE @date2 datetime2 = '2022-01-14 12:32:07. 8494441'. Otherwise, the resulting date has the same day component as. SYSDATE) and subtracting a date from a timestamp (e. JohnD JohnD. 3. The syntax for the DATEDIFF function is as follows:. The following example illustrates how to use the. 取得一季中的第一天:. DD is a two-digit day of the month (01 through 31). SQL - two months from todays date in Oracle. (Oct 2006 - June 2005 = 16) DP_WEEK returns the distance between the weeks capturing the input dates. Query all. Snowflake doesn't offer a function that does that. The following query selects all rows with a date_col value from within the last 30 days: . This question was incorrectly asked. My DOB- 02-feb-1984 so my age should get as 27 Years 2 months 8 days How to do it. There are MANY way to compute the number of years between two dates in Oracle SQL. SQL Query with Dates. It uses month boundaries as calculating the difference in months, with each change in calendar month adding one to the answer. So if there are two dates separated by one day, the year difference can be 1 (see select datediff (year, '20141231', '20150101') ). DATE is the main – or rather, original – datatype used in Oracle for holding dates. Once you have the date difference, you can use simple techniques to express the difference in days, hours, minutes or seconds. dividing by 365. Possible values: text representing an entry in the IANA time zone database. You can even find the number of hours, minutes, seconds, and so on in terms of details in. It’s a seven byte store of century, year, month, day and hour, minute and second. For example: print &order_date () edit 'Month dd, YYYY'. The system calculates the number of complete months between given dates. In Oracle, MONTHS_BETWEEN(date1, date2) function returns the number of months between two dates as a decimal number. DATEDIFF with examples DATEDIFF function accepts 3 parameters, first is datepart (can be an year, quarter, month, day, hour etc. 6789' SECOND (2,3) Rounded to 15. date_open END. The fact that the function returns an integer number of months both when the days of the month are the same (e. You can use this methodology to determine the first day of 3 months ago, and the last day of the previous month: select DATEADD (MONTH, DATEDIFF (MONTH, 0, GETDATE ())-3, 0) --First day of 3 months ago select DATEADD (MONTH, DATEDIFF (MONTH, -1, GETDATE ())-1, -1) --Last Day of previous month. It creates it using the year in cell E17, and the month in cell E17. Currently, my code just returns zero on the right side of the decimal place. 032258Currently, my code just returns zero on the right side of the decimal place. Date2Date. For a complete reference to SQL expressions, go to the Oracle website (requires Oracle account activation). e. Oracle equivalent to SQL Server/Sybase DateDiff. 8. from a date time value. (Oct 10, 2006 - June 14, 2005 = 69) SELECT months_between ( date_1, date_2 )/12 years_between FROM employee. This function is used to get the timestamp value from the specified character string. SELECT * FROM FB as A WHERE A. , YEAR, MONTH, DAY,. here i am trying get the month differences between two. The Oracle ROUND () function takes two arguments: 1) date. In SQL Server, there is a function datediff with datepart 'q'/quarter which behaves as follows :--. Then it subtracts a year if the birthdate hasn't passed. Viewed 44k times 3 I've got 2 date columns in my table (start_date, end_date). There are several date functions (DATENAME, DATEPART, DATEADD, DATEDIFF, etc. SELECT date_part ('month',age ('2016-06-30', '2018-06-30')) The result of this query is 0. Calculate how many years have passed: given year - 1900 2. There are two methods to achieve this. The part to return. DatePart. This page provides you with the most commonly used Oracle date functions that help you handle date and time data easily and more effectively. 005479 0. for oracle: months_between. I) if you need to calculate the elapsed time in seconds between two timestamp columns try this: SELECT extract ( day from (end_timestamp - start_timestamp) )*86400 + extract ( hour from (end_timestamp - start_timestamp) )*3600 + extract ( minute from (end_timestamp - start_timestamp) )*60 + extract ( second from (end_timestamp - start. maybe something like passing an "m" as one of the parameters. For the last row return the calculated date. ReturnDate)) + ' days') ELSE CAST(DATEDIFF(day, Trips. 首先在oracle中没有datediff ()函数. 2903225806 DATE_DIFF =. Fractions are allowed; you can add 2. If you omit it, the ROUND () function. i need to find the difference of two dates as the number of months: find the last day of the month of both the dates. If you enter a negative parameter, the system subtracts the specified days, months, or years. The weekday (dw) datepart returns a number that. date. * , dd. SHOW_DAY is an alias to store the day. That prevents. PostgreSQL - Date Difference in Months. Share. The Question asked for "6 months from the system date". SELECT SYSDATE AS "Date" FROM DUAL; SYSDATE returns the system date and time but does not display the time unless formatted to do so with the function TO_CHAR (): SELECT TO_CHAR (SYSDATE,. 指定した日付の差異。次の値が有効です。 DD: 差異を日数で計算します。. date1. MONTHS_BETWEEN(p1, p2) DATEDIFF( MONTH, CAST(p2 AS float), CAST( DATEADD(DAY, ( -CAST(DATEPART(DAY, p2) AS float(53)) + 1 ), p1) AS float)) Round a Date to a Specific Unit of Measure. @Bruno - If the data types are TIMESTAMP WITH TIME ZONE, the interval that results from subtracting the two should take care of any time zone/ daylight savings time conversion. FromDate, r. *You may also use the DATEDIFF function. If you want to confirm, simply run this. If date1 is earlier than date2, then the result is negative. See Date and Time Data Types and Functions (Transact-SQL) for an overview of all Transact. Get the number of months between two dates. 3. But your query is giving the last date of previous month. Parameter Description; date1, date2: Required. Using datediff in oracle. 40 hours. Then it would also be helpful to be able to. v_modweek := mod ( v_interval, 7); -- calculate how many days remain after computing the total number of. This can have results that you are not expecting. CODE = 'CONTACT_CLIENT' THEN a. select. If either expression is a character or graphic string, it must not be a CLOB. Share. As per the methodology used in this date calculator, a week starts on 'Monday' and ends on 'Sunday'. g. Viewed 3k times 0 I have a table with a date column (DD/MM/YYYY hh:mm:ss) as follows:. StartTime: 2022-27-27 14:00:00 EndTime:2022-12-12 19:30:00 Firstly, to find the time difference, we will use. datediff isn't a function in Oracle. Oracle equivalent to SQL Server/Sybase. DATE_FROM_UNIX_DATE. S is milliseconds in one or up. Arguments. date_from, evnt. 2. SELECT floor ( months_between ( date_1, date_2 )/12) floor_years_between FROM employee. NEXT_DAY: Returns a datetime value that represents the first weekday, named by string-expression, that is later than the date inexpression.