#DateForumTypeThreadPost
1625 Oct 2014 @ 07:14 PDTDatabaseReplyError While Trying to cast as TimestampHi Dieter, The date's stored as a 5 digit integer (just like how Excel stores dates in General format). I would want to extract data for a particular date range. I'm trying to cast the Sta...
1524 Oct 2014 @ 06:59 PDTDatabaseReplyError While Trying to cast as Timestamp Hi Dieter, I tried modifying the script to add the new fields, though I come across errors in this particular line in the above code :   SELECT * FROM Table1 WHERE Strt_Dt_ID ...
1423 Oct 2014 @ 10:28 PDTDatabaseTopicError While Trying to cast as TimestampHi, I'm trying to modify a code script and trying to add a few new fields to it. The tricky part I come across while try to add these fields is while trying to cast them. I would need the form...
1322 Oct 2014 @ 09:47 PDTDatabaseReplyCalculate Last Business Day of Previous MonthHi Dieter, Business Day is a working day between Mon to Fri in a week, except for weekends and holidays in the year (holiday dates are stored in a separate holiday table)
1221 Oct 2014 @ 06:05 PDTDatabaseTopicCalculate Last Business Day of Previous MonthI use the below select query to extract the last date of all completed months (current year to date) : SELECT CALENDAR_DATE-1 AS CALENDAR_DT FROM SYS_CALENDAR.CALENDAR WHERE DAY_OF_MONTH = 1 AN...
1110 Oct 2014 @ 07:33 PDTDatabaseReplyHow to avoid using QUALIFY OVER PARTITION BYThanks a ton Dieter, I was able to work out a solution with your help ..
1009 Oct 2014 @ 05:41 PDTDatabaseReplyHow to avoid using QUALIFY OVER PARTITION BYThis doesn't seem to work for me Dieter..
909 Oct 2014 @ 05:12 PDTDatabaseReplyHow to avoid using QUALIFY OVER PARTITION BYThere is a 1:1 relation for all tables except the table F where there are multiple entries for a record from table A
809 Oct 2014 @ 04:22 PDTDatabaseReplyHow to avoid using QUALIFY OVER PARTITION BYApologies for posting my initial code snippet which is incorrect. I do not use the same table for multiple joins.  The correct query structure is as below : SELECT A.field1, A.field2,...
708 Oct 2014 @ 08:19 PDTDatabaseTopicHow to avoid using QUALIFY OVER PARTITION BY I'm trying to rewrite a query in Teradata in which I'm trying to avoid using the QUALIFY statement for a report. The query layout is as below :   SELECT A.field1, A.fi...
606 Sep 2014 @ 10:17 PDTDatabaseReplyOptimization of a Join QueryHere's the original query structure that is use, but for privacy reason, I've masked the real field names...   SELECT Current.date_field, Current.field1, Current. field2, Curre...
506 Sep 2014 @ 08:51 PDTDatabaseReplyOptimization of a Join QueryHi Dieter,   Thanks for your logic. In the tables that are used in my original query, the fields from the subquery Z are extracted based on the below date condition along with other conditio...
406 Sep 2014 @ 03:34 PDTDatabaseReplyOptimization of a Join QueryI'll try to post the explain plan information. All I can say now is that the data is fetched from views which fetches huge volumes of data if the date field is not used.   How can this q...
306 Sep 2014 @ 01:14 PDTDatabaseTopicOptimization of a Join QueryHi, I've a join query statement in Teradata which I'm trying to optimize inorder to create a report. This query runs on a daily basis. There are 2 parts in the query (by two parts, I means...
225 Aug 2014 @ 12:23 PDTDatabaseReplyHow to fetch only month end dates from SYS_CALENDAR from Current dateHi cmedved, That's exactly the code I was looking out for.. The subquery inside the IN clause resolves my need... Thank you very much !!  
122 Aug 2014 @ 06:47 PDTDatabaseTopicHow to fetch only month end dates from SYS_CALENDAR from Current dateHi, I'm new to this Forum and have been looking around for logic to fetch only month-end dates from SYS_CALENDAR.CALENDAR table. Here's the scenario: I've a query where in I need to ...