Usage Note 30558: "ERROR: Function DATEPART requires a numeric expression as argument 1" in SAS® Web Report Studio
If you create a data item using the DATEPART function, you might see the following error when you attempt to use that data item in SAS Web Report Studio:
ERROR: Function DATEPART requires a numeric expression as argument 1
To resolve this error, recreate the data item expression using the physical data rather than the business data. For example, this is how you would create the data item expression in SAS Information Map Studio:
- Open the data item's properties.
Note: The data item should be classified as a Category.
- On the Definition tab, click Edit to open the Expression Editor dialog box.
- Make sure the Type is set to Numeric.
- Clear the Expression Text field.
- Insert DATEPART from the list of Functions. Your expression will look like this:
DATEPART(<timestampValue>)
- Click the Data Sources tab.
- Open the Physical Data tree, and select the date/time column that you want to use in the data item expression.
- Click Add to Expression.
Your expression might look like this:
DATEPART(<<SASHELP.closeDate>>)
- Click OK to save and close the Expression Editor.
- Click OK to save and close the Properties.
Operating System and Release Information
| SAS System | SAS Web Report Studio | Microsoft Windows Server 2003 Enterprise Edition | 3.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows Server 2003 Datacenter Edition | 3.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows NT Workstation | 3.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows 2000 Professional | 3.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows 2000 Server | 3.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows 2000 Datacenter Server | 3.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows 2000 Advanced Server | 3.1 | | 9.1 TS1M3 SP4 | |
| Microsoft® Windows® for x64 | 3.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows Server 2003 Standard Edition | 3.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows XP Professional | 3.1 | | 9.1 TS1M3 SP4 | |
| Windows Vista | 3.1 | | 9.1 TS1M3 SP4 | |
| 64-bit Enabled AIX | 3.1 | | 9.1 TS1M3 SP4 | |
| 64-bit Enabled Solaris | 3.1 | | 9.1 TS1M3 SP4 | |
| HP-UX IPF | 3.1 | | 9.1 TS1M3 SP4 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Date Modified: | 2007-11-14 17:20:18 |
| Date Created: | 2007-11-14 13:50:37 |