Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
angela_g
Starting Member
17 Posts |
Posted - 2014-05-22 : 06:58:23
|
Hi Can anyone help me? I have found a query which contains something I dont recognise, what is the query requesting? >= ADD_MONTHS ( trunc(SYSDATE), -1)Thank you in advance! |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2014-05-22 : 07:10:10
|
That isn't MS SQL Serversee here:https://www.google.de/#q=ADD_MONTHS+(+trunc(SYSDATE)%2C+-1) Too old to Rock'n'Roll too young to die. |
 |
|
adsingh82
Starting Member
20 Posts |
Posted - 2014-05-22 : 09:46:11
|
sysdate will produce the the current datetime and trunc will extract only the date part add_months subtracting one month from the current dateSo this condition will result last one month dataRegards,Alwyn.M |
 |
|
GouravSaxena1987
Starting Member
23 Posts |
Posted - 2014-05-22 : 12:55:45
|
Hello,It will give you exactly one month previous date without any Hours,Minutes,Second values.i.e.If today date is - 22/05/2014:00:00:00ADD_MONTHS ( trunc(SYSDATE), -1) will give : 22/04/2014for reference please check:http://www.techonthenet.com/oracle/functions/trunc_date.phphttp://w3mentor.com/learn/procedural-language-structured-query-language/date-functions/date-functions-%E2%80%93-add_months/Regards,Gourav SaxenaData Warehouse CounsultantGouravSaxena1987@gmail.com |
 |
|
|
|
|