Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2005
    Location
    Brooklyn, ny
    Posts
    69

    Unanswered: change the field name to a Current Run Date in query

    Hello,
    Is it possible to change the field name to a Current Run Date format in query?
    I have a query with some fields as Current Week Sales , Current Month Sales
    I would like to remane thses fields to show the current run date.
    Current Week Sales (date run mm/dd/yyyy )


    Thank you in advance.

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Use the Format function within your query. Something like:

    Query crap.... WHERE Format(dateFieldNameUsedInQuery, "mm/dd/yyy") = ....other Query crap


    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  3. #3
    Join Date
    Sep 2005
    Location
    Brooklyn, ny
    Posts
    69
    I need to change the field name, not the data inside of that field, but field itself to the current data.

    If the field is Current_Data,
    I need to change it to Current_Date + Date()

    Thank you so much for your help.

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    Ohhhh....I see. Well, aint I just a dirty old pillow puffer.

    Curious...Lets have a look at your current query. It almost sounds like you want to utilize variables within your query but it's hard to tell with the absolutely astounding description you had provided within your initial post.

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  5. #5
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    You can make a CreateTable Query putting your output in a table then use the
    TableDef to change the names of the fields.
    I haven't tried it before but just try

    dim db as DataBase
    Set db = currentDB
    db.TableDefs("YourResultedTableName").Fields("yourField2bchanged").Name= yourNewFieldName

  6. #6
    Join Date
    Sep 2005
    Location
    Brooklyn, ny
    Posts
    69
    Thank you for all the help,

    This is a query I have in which I have to change the fields (in bolt) to a Name as is + curr date it run.

    SELECT SalesGroup,
    ProductGroup,
    FabricGroup,
    dbo_stylmstr.STYLE_NUM,
    CCur(dbo_stylmstr.whlsep*2) AS [Retail Price],
    IIf(CurrWeekBySalesGrProdGrStyleColor.[Current Week Units] Is Null,0,CurrWeekBySalesGrProdGrStyleColor.[Current Week Units]) AS Current_Week_Units, IIf(CurrWeekBySalesGrProdGrStyleColor.[SumOfExtended Retail] Is Null,0,CCur(CurrWeekBySalesGrProdGrStyleColor.[SumOfExtended Retail])) AS Current_Week_Sales,
    IIf([Current Month Units] Is Null,0,[Current Month Units]) AS Current_Month_Units,
    IIf(CurrMonBySalesGrProdGrStyleColor.[SumOfExtended Retail] Is Null,0,CCur(CurrMonBySalesGrProdGrStyleColor.[SumOfExtended Retail])) AS Current_Month_Sales,
    IIf([Current Year Units] Is Null,0,[Current Year Units]) AS Current_Year_Units,
    IIf(CurrYearBySalesGrProdGrStyleColor.[SumOfExtended Retail] Is Null,0,CCur(CurrYearBySalesGrProdGrStyleColor.[SumOfExtended Retail])) AS Current_Year_Sales
    FROM ......
    WHERE (((dbo_FinishedGoods_BoltOn.Location)="ss"))
    GROUP BY .....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •