Re: Truncate Statement
- From: "Michael C#" <howsa@xxxxxxxxxxx>
- Date: Mon, 13 Jun 2005 14:23:29 -0400
FYI, it will be a little more complex than this since you want to reference
the dates from another column in another table, but the general idea is use
the DatePart(month, ...) to get the month out of a date. Thanks.
"Michael C#" <howsa@xxxxxxxxxxx> wrote in message
news:%23dPrNSEcFHA.228@xxxxxxxxxxxxxxxxxxxxxxx
> ... WHERE DatePart(month, [date_column]) = DatePart(month, GetDate())
> or
> ... WHERE DatePart(month, [date_column]) = DatePart(month,
> Current_Timestamp)
>
>
> "Granville" <Granville@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:6DFF2B51-31AE-4906-B3BE-D5B017647309@xxxxxxxxxxxxxxxx
>> Good day everyone
>>
>> I have two SQL tables. One is a "Data" table in it with the days in the
>> dd/mm/yyy format.
>>
>> Another "Time" table has the
>> dd/mm/yyy , Month, Quarter , Year in it.
>>
>> I want to truncate the "Data" table but only where the Month is equal to
>> current month.
>> Rather than putting in a string "manually" I want the truncate statement
>> to
>> pick up today's date, look in the "Time" table, pick up the month that
>> current day belongs to and truncate all those days out of the "Data"
>> table.
>>
>> I've not even started so any ideas will be welcomed?
>>
>> Thanks
>>
>> Granville
>>
>
>
.
- References:
- Truncate Statement
- From: Granville
- Re: Truncate Statement
- From: Michael C#
- Truncate Statement
- Prev by Date: Re: Truncate Statement
- Next by Date: Using cubes to show string values ?!
- Previous by thread: Re: Truncate Statement
- Next by thread: Using cubes to show string values ?!
- Index(es):
Loading