need query to random update field with 0,1,2,3 or 4

Hi, I need to update a field with a random number 0 1 2 3 or 4 in order to 
test a report. Can anyone set me up with a query for this? There is no 
criteria to update from, it should update all records in the table.

Thanks,
Robbie 


0
Rob
8/7/2007 7:06:30 PM
access 16762 articles. 3 followers. Follow

2 Replies
825 Views

Similar Articles

[PageSpeed] 56

On Tue, 7 Aug 2007 12:06:30 -0700, "Rob" <rob@nospam.com> wrote:

>Hi, I need to update a field with a random number 0 1 2 3 or 4 in order to 
>test a report. Can anyone set me up with a query for this? There is no 
>criteria to update from, it should update all records in the table.
>
>Thanks,
>Robbie 
>

UPDATE yourtable
SET yourtable.fieldname = Int(5*Rnd([ID]));

where ID is some non-negative numeric field within the table.

             John W. Vinson [MVP]
0
John
8/7/2007 8:24:23 PM
Thanks!

"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message 
news:q5lhb3l7328vqd20ct309pirrg227f0e6c@4ax.com...
> On Tue, 7 Aug 2007 12:06:30 -0700, "Rob" <rob@nospam.com> wrote:
>
>>Hi, I need to update a field with a random number 0 1 2 3 or 4 in order to
>>test a report. Can anyone set me up with a query for this? There is no
>>criteria to update from, it should update all records in the table.
>>
>>Thanks,
>>Robbie
>>
>
> UPDATE yourtable
> SET yourtable.fieldname = Int(5*Rnd([ID]));
>
> where ID is some non-negative numeric field within the table.
>
>             John W. Vinson [MVP] 


0
Rob
8/7/2007 8:43:23 PM
Reply:

Similar Artilces:

Lookup based on criteria in 2 columns
Hi, I am trying to use a vlookup or other function to return the value in the amount column based on the location and date. Here is a sample of my data: Location Date Amount 101 9/15/8 10 101 9/16/8 20 101 9/17/8 15 102 9/15/8 50 102 9/16/8 75 102 9/17/8 67 For example if I wanted to return the amount for location 102 on 9/15/8, what formula would I use? I tried using variations of vlookups but had no luck. Thanks, =SUMPRODUCT(--(A2:A50=102),--(B2:B50=DATE(2008,9,15)),C2:C50) -- Regards, Peo Sjo...

Outlook needs Outlook Express to work
I've installed my Outlook 2002 on my new Vista PC (I had Xp before). Now when I start Outlook it says "requires Outlook Express 4.01 or greater". I've been looking for Outlook Express to download and install but no joy. No CD came with my new Vista PC. Any ideas, short of buying a more modern Outlook? Vista doesn't actually support Outlook 2002 or older. Outlook Express is part of Internet Explorer but with the advent of Vista, it was switched to Windows Mail. There is no more Outlook Express. You could attempt however to create a profile using workgroup or c...

Money is already running #4
I have experienced the "Money is already running" problem with Money 2006 and thought I would try Money 2007 to see if the problem went away.. NOPE.. I have tried all of the suggestions, switch automatic backup off, etc.. etc.. nothing helps. I have noticed that this only happens when Outlook is running, I called MS tech support (now there's an experience in futility) and we have had no success. Any ideas... Does closing the program from File - Exit make a difference? -- Michael Gordon "Rick B" <Rick B@discussions.microsoft.com> wrote in message news:...

Address book updating...
Hello all, I have noticed since we moved to Exchange 2003 that it takes a long time (several hours) before I see newly created accounts in the address book. Is there somewhere I can adjust the update time? TIA, Gary Check the update interval in the RUS (Recipient Update Service). Teo "GaryH" wrote: > Hello all, > I have noticed since we moved to Exchange 2003 that it takes a long time > (several hours) before I see newly created accounts in the address book. > Is there somewhere I can adjust the update time? > TIA, > Gary > > > Thank you...I will ...

Compare records in a query then write equation??
Hi all, i have a problem and i need help, the case is as follows: the default rule is that i have 4 fields, (Date, Team, Score). each team is allowed to have one score per day but sometimes it can have 2 scores per day, when this is the case i wanna multiply each score by a certain number and have one score instead of 2 scores (similar to average but not average). So, i need to have a condition which compares records, and if this is the case, formulates this equation and gives me one score instead of 2 scores. Please help SELECT Team, [Date], Sum(Score)/Count(Score) * IIF(Count(Score) =1,1,S...

Rollup 2 and Office 2007
I already have Roll Up 1 and the Office 2007 compatibility patch installed. If I now install roll up 2 will I have to reinstall the office 2007 compatibility? yes -- Regards, MS CRM Certified Professional http://microsoftcrm3.blogspot.com Chat with me on MSN / Gmail / Skype : ID Is :.. mscrmexpert@gmail.com "LLoyd" wrote: > I already have Roll Up 1 and the Office 2007 compatibility patch installed. > If I now install roll up 2 will I have to reinstall the office 2007 > compatibility? ...

Microsoft POS #2
I have a group of customers that I am working on setting up A bundled POS system for. I have looked at RMS and Microsoft POS. The customer's are small bulk food stores. They package all of the bulk food in various containers and weigh it with a Hobart scale producing a label with an system 2 price enbedded barcode. These are UPC A formats. They are for the most part simple single store installs and donot require the complex RMS system. I have setup the Microsoft POS version 2.0 and found it will work perfect for these customers. The only problem when you programed the system you l...

Outlook 2003 keeps crashing #2
I get this message when I look in System information. Outlook keeps crashing quite often. I cannot for example delete two messages without outlook crashing. My colleagues do not have this problem. We are using the Microsoft mail exhange server. Faulting application outlook.exe, version 11.0.5510.0, stamp 3f1380f0, faulting module mso.dll, version 11.0.5606.0, stamp 3f334cce, debug? 0, fault address 0x003b6e16. Does anyone has a solution?=20 Best regards/ Bj=F6rn 1) I would definitely apply Service Pack 2for Office 2003 + applicable critical security updates. 2) Have you tried starting O...

Before Update on record select
I am getting no where fast. I have a main form and sub form and what i need is a message to appear when user moves on to the next record using the record selector on the bottom of the form. I have tried the beforeupdate on the form but no results. Can form design prevent a message prompt? One problem is that if no changes to the current record have been changed, the Before Update event will not fire. If you do make a change, the code as is should work. I have gotten into the habbit of not using the standard record navigators, but write my own so I can easily deal with this. -- Dave Ha...

Copy entire row where CellValue=0
I need to loop through the collumn and search for value that is more then 0. When I find it I need to copy whole row and paste it 2-3 rows below the table. I tried to select the collumn and search the selection but for some reason I copy and paste only one row. Thank you for any help. Hi as a starting point: http://www.rondebruin.nl/copy5.htm -- Regards Frank Kabel Frankfurt, Germany "OxanaB" <OxanaB@discussions.microsoft.com> schrieb im Newsbeitrag news:8628F791-CF2D-480A-9EBF-6C31BCEF0293@microsoft.com... > I need to loop through the collumn and search for value tha...

Looking for XPathReader 1.1
Where is XPathReader 1.1 available for download? I have 1.0 and found the 2005 MS announcement for 1.1 but the link was for godotnet which no longer exists. Nothing shows up in a search at the MS download center or Google. Bill ...

Customized Toolbar RestoreState() fails if it has only 1 button
This issue happens only when the numbers of buttons in the tool bar is "1". Thats is, the user launches the customize toolbar dialog and removes all but 1 tool bar button. I have multiple Tool bars which I persist on application close and restore on application load. The SaveState() works fine as I notice the value "55 81 00 00" saved if only 1 button is left in the Tool bar. Here is the code for the RestoreState for (int i = 0; i < m_ToolBars.GetSize(); i++) { HKEY hSecKey = AfxGetApp()->GetSectionKey("Tool Bars"); if (hSecKey == NULL) break; CS...

pop3 #3
My outlook express hasnt been working since I got my new Dell computer. It says that the "POP3" isnt connected so i cant receive or send e-mail!!! HELP!! How do i fix this problem? I've tried calling Dell and Microsoft and have waited hours on the phone and have not gotten any assistance! Who is your ISP/mail host? Seems like you might want to contact them for support. I presume you can get to the Internet just fine.... rose wrote: > My outlook express hasnt been working since I got my new > Dell computer. It says that the "POP3" isnt connected so > i ca...

SMTP Connectors #4
Hi, I have a problem with two Front-End servers in NLB. I have two connectors with address space *, one connector with cost 10 the other with cost 20 for connector availability purposes. Inbound mails are targeted to FrontEnd1, outbound mails should go from FrontEnd2 (e.g. MX for FrontEnd1 cost is 10; MX cost for FrontEnd2 is 20) Connectors: FrontEnd1 - Address space * - cost 10 - bridgehead srv = FrontEnd1; FrontEnd2 - Address space * - cost 20 - bridgehead srv = FrontEnd2 The problem: If both servers are up and running and somehow some mail ends in queue on FrontEnd2 it correctly crea...

Need help with Auto Filter
I have a spreedsheet that is filtered in multiple columns. I am running a "Subtotal" function to count certian rows when I filter the column. My question is this. Is there a way to save or freeze the data that the subtotal function counts in a different cell. In other words I want subtotal to count everything in a particular column but I want to be able to save that number somewhere so that when I filter again with another variable I am able to still view the first subtotal to compare the two. I hope this makes sense and thanks in advance for any assistance you can provi...

Filter recordset using query results
Hi all I have a form based on a query called [qry Quarterly Planning], it lists all Itineraries on the system. On this form you can filter records by specifying a Start and End Date for the [ReviewDate] and/or [Specialist]. It is a subform on a main unbound form, lets call this Subform1. Along side this I have another subform (Subform2) which displays ReviewDates that exist against an Itinerary. In other words Subform1 has a start date of an activity and if the activity lasts longer than 1 day, then the additional dates are stored in Subform2 (ItineraryDates). Currently when I...

adding name /creating field/query?
Hello, I can create an invoice_number field in a query using the primary field ID from the main table as invoice_number: ID but if ID say is 100, I cannot work out how to create renewal_invoice_100 Cheers Geoff Geoff We aren't there. We can't see what you're looking at. Where did "renewal_invoice_100" come from and what does it mean? Please post the SQL statement of the query you are trying to use. -- Regards Jeff Boyce www.InformationFutures.net Microsoft Office/Access MVP http://mvp.support.microsoft.com/ Microsoft IT Academy Program Mentor http://micro...

Exchange update problem
I have tried to upgrade exch2k3 sp1 to sp2, but the update fails with "the file pcproxy.dll is in use, and setup cannot identify the app or srvc. setup cannot continue" Any clues/ideas/suggestions? Please. -- ----------------------------------------------------------------------------------------------------------------------- This message has been checked for all known viruses. The information contained in this e-mail and any attachments is confidential and may be the subject of legal, professional or other privilege. It is intended for the named addressee only and may not ...

how do I automatically update a text box in a chart?
Hi, You can link the textbox to a cell. When you update the cell the textbox should reflect this. Select the textbox border and then in the formula bar enter the complete cell reference, for example, =Sheet1!A1 Cheers Andy Kath wrote: -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info ...

Linker Error after upgrade from VC7.1
Hello all, After upgrading a VC7.1 project to visual studio 2005, it failed to build in the release configuration with the follwoing error : 1>nafxcw.lib(winocc.obj) : error LNK2005: "public: class CWnd * __thiscall CWnd::GetDlgItem(int)const " (?GetDlgItem@CWnd@@QBEPAV1@H@Z) already defined in InstallDlg.obj The debug build works fine. The project uses MFC in a static library. Well, after doing some research, it seems that this one is tied to the fact that in a release configuration, _AFX_ENABLE_INLINES is defined, so inline functions are embedded in the .obj file. Sure there...

HELP! Need to export hourly sales data on POS (NOT RMS)
How can I export hourly sales data across a date range? For instance, I want to show hourly sales for the month of October so I can graph it and post it in our break room. If I can't export hourly data, can I export daily sales? The built-in reports don't address this data format. This is a multi-part message in MIME format. ------=_NextPart_000_008E_01C826DC.CBC512D0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit Mark, This should work for you. Keep in mind it takes up to 5-10 minutes to load...

Excel DNS query
Hello, Is there a way for an Excel function to query a DNS server? Thanks. Soundy Not that I know of, but you can turn on the macro recorder, use 'get external data' and tailor the resulting code into a user function of your own. E.g. I've used this to create a button to get MS-Access data from a query that has the same name as the sheet (tab) name. It saves me a lot of copy-paste actions. Bas Hartkamp <soundy@gmail.com> schreef in bericht news:1151940450.029823.127570@j8g2000cwa.googlegroups.com... > Hello, > > Is there a way for an Excel function ...

Please ignore #2
Testing a posting problem -- Jim Bunton ...

Need Query Help
I have two tables, Table A & Table B, in my database that have the same fields (Name, SSN, etc). Most of the records in both tables are identical, but each table has some unique records. I would like to run a query that will select the unique records in Table A by comparing SSNs, and then do the same for Table B. I am a database novice, and have tried all the wizards and expression builders with no luck. Any help at all would be appreciated. Thank you!!! Scott Casa Grande, AZ Hi Scott, The "Find Unmatched Query Wizard" is what you need. If you only want to check for SSNs ...

Outlook freezes after sending one email after upgrading 4.0
We just upgraded from 3.0 to 4.0 this weekend. All client machines have had the desktop client upgraded and 2 have the same issue. One is XP with Outlook 2003 and the other is Vista with Outlook 2007. Open opens and the CRM addin initializes correctly. As soon as you compose and send an email, Outlook locks up and you have to kill the process in task manager to close Outlook. I've had the same problem and have tried all I can think of...how did you fix this issue? Thank you. "Sander" wrote: > We just upgraded from 3.0 to 4.0 this weekend. All client machines have...