December 3, 2018 at 11:41 am
Hello Gentlemen
Your kind support
Question: to create two new tables mentioned below conditions
Table 1 named Calendar
Table 2 named DataBT.
1- Calendar table in holiday calendar from the year 2000 to the year 2050 which included, working days, holiday, national days.
2- DataBT table should contains two columns "Date1" and "DateNote" where DataNote column is a calculated column where it adds 10 days to Date1 and displays results. I am sure if "user-defined function" is helpful to join it from the calendar table. Your kind support in this matter
More Explaination:-
Date1 column date type Date (Manually Entered)
DateNote column (Auto calculated column during table creation) = Date1 + 10 working days (Condition it should not include weekends and holidays. Further if the "result" comes on the weekend it should jump to next working day. It should check holidays from calendar table)
Kind Regards
Az
December 3, 2018 at 11:45 am
awzali - Monday, December 3, 2018 11:41 AMHello GentlemenYour kind support in below
Table 1 named Calendar
Table 2 DataBT.Calendar table in holiday calendar from the year 2000 to the year 2050 which included, working days, holiday, national days.
DataBT table contains two columns "Date1" and "DateNote" where DataNote column is a calculated column where it adds 10 days to Date1 and displays results. I am sure if "user-defined function" is helpful to join it from the calendar table. Your kind support in this matterDate1 column date type Date
DateNote column calculated column which is equal to Date1 + 10 working days (Condition it should not include weekends and holidays. Further if the "result" comes on the weekend it should jump to next working day. It should check holidays from calendar table)Kind Regards
Az
I cannot see a question here. What are you trying to achieve?
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
December 3, 2018 at 11:51 am
Phil Parkin - Monday, December 3, 2018 11:45 AMI cannot see a question here. What are you trying to achieve?
Is is clear now? i have updated it need two tables to create as mentioned
December 3, 2018 at 1:20 pm
A computed column can't access the data in another table in the computation. You need a view, table valued function or a procedure.
December 3, 2018 at 9:17 pm
Joe Torre - Monday, December 3, 2018 1:20 PMA computed column can't access the data in another table in the computation. You need a view, table valued function or a procedure.
Ok thanks, can you help me with that. I am a beginner.
December 4, 2018 at 7:22 am
Please post create table an inserts with sample data for both tables.
December 4, 2018 at 10:27 am
Calendar Table - http://www.sqlservercentral.com/articles/calendar/145206/
That will help you get this done. Depending on your locale, this might need modifications.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply