on 05-05-2014 3:04 PM
Esta vez requiero su ayuda porque estoy aplicando el siguiente query
estoy copiando un campo el cual es tipo fecha pero a ese campo le debo agregar 5 días si hago la consulta
Select $[OPOR.U_HBT_Festarribo] me copia el campo pero necesito que ademas de copiarme el campo me agregue 5 días ya intente
Select $[OPOR.U_HBT_Festarribo] + 5 intente usar dateadd y tampoco me funciono y si hago la consulta con from en la búsqueda formateada solo me muestra una lista desplegable pero no coloca el campo automaticamente
Hola Juan Franco,
Tal vez es tarde para contestar pero ya hice el ejercicio.
Lo que falta es definir el tipo de dato en la consulta. La consulta para sumar 5 días del valor en pantalla sería asi:
Select dateadd(d,5,$[OCRD.U_Fecha1.date])
Donde lo que te falta es el .date al final del campo para que en la busqueda formateada devuelva el valor como una fecha.
Espero te funcione.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Juan,
Prueba con esta consulta
declare @fecha as datetime
set @fecha=$[OPOR.docdate]
select dateadd(d,5,@fecha)
En tu caso coloca el campo de usuario de tipo fecha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
al parecer debería funcionar pero es un campo date según muestra sap probando como me dices me tira este error
1). [Microsoft][SQL Server Native Client 10.0][SQL Server]The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value
y si lo coloco declare @fecha as date me tira este
1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.
sabes cual podría ser el error sera que es string ?
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.