Exemple #1
0
        public override string dateExpression(string dateCol, string timeCol, LiftCommon.DBFormatter.TimeUnit timeUnit)
        {
            StringBuilder dateExp = new StringBuilder();

            dateExp.Append("CONVERT");
            dateExp.Append("( DATETIME, CONVERT( VARCHAR(10), MONTH( ${DATECOL} )) + ");
            dateExp.Append("'/' + CONVERT( VARCHAR(10), DAY( ${DATECOL} ) )+ ");
            dateExp.Append("'/' + CONVERT( VARCHAR(10), YEAR( ${DATECOL} ))");
            dateExp.Append(" +' ' + ");


            if (timeUnit == TimeUnit.seconds)
            {
                dateExp.Append(" CONVERT( VARCHAR( 10) , CAST ( ${TIMECOL}/3600  AS INT ) ) ");
                dateExp.Append(" 	+':'   +  CONVERT( VARCHAR(10), CAST( (CAST( ${TIMECOL}  AS INT)% 3600) / 60 AS INT))");
                dateExp.Append(" 	+':'   +  CONVERT( VARCHAR(10), CAST( ${TIMECOL}  AS INT)% 60))");
            }
            else
            {
                dateExp.Append(" CONVERT( VARCHAR( 10) , CAST ( ${TIMECOL}/60  AS INT ) ) ");
                dateExp.Append(" 	+':'   +  CONVERT( VARCHAR(10), CAST ( ${TIMECOL}  AS int)% 60)");
                dateExp.Append(" + ':00')");
            }

            dateExp.Replace("${DATECOL}", dateCol);
            dateExp.Replace("${TIMECOL}", timeCol);


            return(dateExp.ToString());
        }
Exemple #2
0
        public override string dateExpression(string dateCol, string timeCol, LiftCommon.DBFormatter.TimeUnit timeUnit)
        {
            StringBuilder dateExp = new StringBuilder();

            dateExp.Append("cdate(");


            dateExp.Append("MONTH( ${DATECOL} ) ");
            dateExp.Append(ConCat);
            dateExp.Append("'/' ");
            dateExp.Append(ConCat);
            dateExp.Append("DAY( ${DATECOL} ) ");
            dateExp.Append(ConCat);
            dateExp.Append("'/' ");
            dateExp.Append(ConCat);
            dateExp.Append("YEAR( ${DATECOL} ) ");
            dateExp.Append(ConCat);
            dateExp.Append("' ' ");
            dateExp.Append(ConCat);

            if (timeUnit == TimeUnit.seconds)
            {
                dateExp.Append(" INT(${TIMECOL}/3600 ) ");
                dateExp.Append(ConCat);
                dateExp.Append("':' ");
                dateExp.Append(ConCat);
                dateExp.Append(" IIF( INT  ((${TIMECOL} MOD 3600) / 60) < 10, '0' ");
                dateExp.Append(ConCat);
                dateExp.Append(" INT  ((${TIMECOL} MOD 3600) / 60), INT ((${TIMECOL} MOD 3600) / 60) ) ");
                dateExp.Append(ConCat);
                dateExp.Append("':' ");
                dateExp.Append(ConCat);
                dateExp.Append("IIF( ${TIMECOL} MOD 60 < 10, '0' ");
                dateExp.Append(ConCat);
                dateExp.Append("	${TIMECOL} MOD 60, ${TIMECOL} MOD 60 ) ");
            }
            else
            {
                dateExp.Append(" INT(${TIMECOL}/60 )  ");
                dateExp.Append(ConCat);
                dateExp.Append("':'  ");
                dateExp.Append(ConCat);
                dateExp.Append("IIF( ${TIMECOL} MOD 60 < 10, '0' ");
                dateExp.Append(ConCat);
                dateExp.Append("${TIMECOL} MOD 60 , ${TIMECOL} MOD 60");
                dateExp.Append(ConCat);
                dateExp.Append("':00')");
            }


            dateExp.Append(")");

            dateExp.Replace("${DATECOL}", dateCol);
            dateExp.Replace("${TIMECOL}", timeCol);


            return(dateExp.ToString());
        }
Exemple #3
0
        public override string dateExpression(DateTime datePart, int timePart, LiftCommon.DBFormatter.TimeUnit timeUnit)
        {
            StringBuilder dateExp = new StringBuilder();

            dateExp.Append("cdate( ");
            dateExp.Append(base.dateExpression(datePart, timePart, timeUnit));
            dateExp.Append(")");


            return(dateExp.ToString());
        }
Exemple #4
0
 public virtual string dateExpression(string dateCol, string hrCol, string minCol, string secCol, LiftCommon.DBFormatter.TimeUnit timeUnit)
 {
     return(string.Empty);
 }
Exemple #5
0
        public override string dateExpression(string dateCol, string hrCol, string minCol, string secCol, LiftCommon.DBFormatter.TimeUnit timeUnit)
        {
            StringBuilder dateExp = new StringBuilder();

            dateExp.Append("CONVERT");
            dateExp.Append("( DATETIME, CONVERT( VARCHAR(10), MONTH( ${DATECOL} )) + ");
            dateExp.Append("'/' + CONVERT( VARCHAR(10), DAY( ${DATECOL} ) )+ ");
            dateExp.Append("'/' + CONVERT( VARCHAR(10), YEAR( ${DATECOL} ))");
            dateExp.Append(" +' ' + ");


            if (timeUnit == TimeUnit.seconds)
            {
                dateExp.Append(" CONVERT( VARCHAR( 10) , ${HRCOL} ) ");
                dateExp.Append(" 	+':'   +  CONVERT( VARCHAR(10), ${MINCOL})");
                dateExp.Append(" 	+':'   +  CONVERT( VARCHAR(10),  ${SECCOL})");
            }
            else
            {
                dateExp.Append(" CONVERT( VARCHAR( 10) , ${HRCOL}) ");
                dateExp.Append(" 	+':'   +  CONVERT( VARCHAR(10),  ${MINCOL})");
                dateExp.Append(" + ':00')");
            }

            dateExp.Append(" ) ");

            dateExp.Replace("${DATECOL}", dateCol);
            dateExp.Replace("${HRCOL}", hrCol);
            dateExp.Replace("${MINCOL}", minCol);

            if (timeUnit == TimeUnit.seconds)
            {
                dateExp.Replace("${SECCOL}", secCol);
            }


            return(dateExp.ToString());
        }
Exemple #6
0
        public override string dateExpression(string dateCol, string hrCol, string minCol, string secCol, LiftCommon.DBFormatter.TimeUnit timeUnit)
        {
            StringBuilder dateExp = new StringBuilder();

            dateExp.Append("cdate(");


            dateExp.Append("MONTH( ${DATECOL} ) ");
            dateExp.Append(ConCat);
            dateExp.Append("'/' ");
            dateExp.Append(ConCat);
            dateExp.Append("DAY( ${DATECOL} ) ");
            dateExp.Append(ConCat);
            dateExp.Append("'/' ");
            dateExp.Append(ConCat);
            dateExp.Append("YEAR( ${DATECOL} ) ");
            dateExp.Append(ConCat);
            dateExp.Append("' ' ");
            dateExp.Append(ConCat);

            if (timeUnit == TimeUnit.seconds)
            {
                dateExp.Append(" ${HRCOL} ");
                dateExp.Append(ConCat);
                dateExp.Append("':' ");
                dateExp.Append(ConCat);
                dateExp.Append(" IIF( ${MINCOL} < 10, '0' & ${MINCOL}, ${MINCOL}) ");
                dateExp.Append(ConCat);
                dateExp.Append("':' ");
                dateExp.Append(ConCat);
                dateExp.Append(" IIF( ${SECCOL} < 10, '0' & ${MINCOL}, ${MINCOL})");
            }
            else
            {
                dateExp.Append(" ${HRCOL} ");
                dateExp.Append(ConCat);
                dateExp.Append("':'  ");
                dateExp.Append(ConCat);
                dateExp.Append(" IIF( ${MINCOL} < 10, '0' & ${MINCOL}, ${MINCOL}) ");
                dateExp.Append(ConCat);
                dateExp.Append("':00'");
            }


            dateExp.Append(")");

            dateExp.Replace("${DATECOL}", dateCol);
            dateExp.Replace("${HRCOL}", hrCol);
            dateExp.Replace("${MINCOL}", minCol);

            if (timeUnit == TimeUnit.seconds)
            {
                dateExp.Replace("${SECCOL}", secCol);
            }


            return(dateExp.ToString());
        }