public override string Translate(SqlDateTimeOffsetPart part)
        {
            switch (part)
            {
            case SqlDateTimeOffsetPart.Millisecond:
                return("MILLISECONDS");

            case SqlDateTimeOffsetPart.DayOfYear:
                return("DOY");

            case SqlDateTimeOffsetPart.DayOfWeek:
                return("DOW");

            case SqlDateTimeOffsetPart.Offset:
                return("TIMEZONE");

            case SqlDateTimeOffsetPart.TimeZoneHour:
                return("TIMEZONE_HOUR");

            case SqlDateTimeOffsetPart.TimeZoneMinute:
                return("TIMEZONE_MINUTE");
            }

            return(base.Translate(part));
        }
 public SqlExtract(SqlDateTimeOffsetPart dateTimeOffsetPart, SqlExpression operand)
     : base(SqlNodeType.Extract)
 {
     DateTimePart       = SqlDateTimePart.Nothing;
     IntervalPart       = SqlIntervalPart.Nothing;
     DateTimeOffsetPart = dateTimeOffsetPart;
     Operand            = operand;
 }
        private static SqlDateTimePart ConvertDateTimeOffsetPartToDateTimePart(SqlDateTimeOffsetPart dateTimeOffsetPart)
        {
            switch (dateTimeOffsetPart)
            {
            case SqlDateTimeOffsetPart.Year:
                return(SqlDateTimePart.Year);

            case SqlDateTimeOffsetPart.Month:
                return(SqlDateTimePart.Month);

            case SqlDateTimeOffsetPart.Day:
                return(SqlDateTimePart.Day);

            case SqlDateTimeOffsetPart.Hour:
                return(SqlDateTimePart.Hour);

            case SqlDateTimeOffsetPart.Minute:
                return(SqlDateTimePart.Minute);

            case SqlDateTimeOffsetPart.Second:
                return(SqlDateTimePart.Second);

            case SqlDateTimeOffsetPart.Millisecond:
                return(SqlDateTimePart.Millisecond);

            case SqlDateTimeOffsetPart.Nanosecond:
                return(SqlDateTimePart.Nanosecond);

            case SqlDateTimeOffsetPart.DayOfYear:
                return(SqlDateTimePart.DayOfYear);

            case SqlDateTimeOffsetPart.DayOfWeek:
                return(SqlDateTimePart.DayOfWeek);

            case SqlDateTimeOffsetPart.TimeZoneHour:
                return(SqlDateTimePart.TimeZoneHour);

            case SqlDateTimeOffsetPart.TimeZoneMinute:
                return(SqlDateTimePart.TimeZoneMinute);
            }
            throw SqlHelper.NotSupported(string.Format("Converting {0} to SqlDateTimePart", dateTimeOffsetPart));
        }